Skip to content

Commit

Permalink
Fixing Can't Update To Newer Version Of ChromeDriver And Adding Some …
Browse files Browse the repository at this point in the history
…New Setting For Widht and Height Of The Resolution
  • Loading branch information
brotherzhafif committed Feb 26, 2023
1 parent 3b21566 commit 85e4e28
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<add key="dir" value="Saved\\"/>
<add key="jumlah" value="20"/>
<add key="judul" value="Windy.com"/>

<add key="W" value="1280"/>
<add key="H" value="720"/>

</appSettings>

Expand Down
4 changes: 2 additions & 2 deletions BMKG Windy Auto Screenshot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

<ItemGroup>
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.4.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.8.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ internal class Program
{

public static string dir = GetSetting("dir").ToString() + DateTime.Now.ToString("dd" + " MMMM" + " yyyy");
public static string W = GetSetting("W").ToString();
public static string H = GetSetting("H").ToString();
public static string nama = "";
public static string link = "";
public static string Y;
Expand Down Expand Up @@ -77,14 +79,13 @@ private static void CaptureCosutmeLink()
options.AddArgument("--disable-gpu");
options.AddArgument("test-type");
options.AddArgument("start-maximized");
options.AddArgument("--window-size=1280,720");
options.AddArgument("--window-size="+ W +"," + H);
options.AddArgument("test-type=browser");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--enable-precise-memory-info");
options.AddArgument("--disable-default-apps");
options.AddArguments("--disable-popup-blocking");
options.AddArgument("--headless");
options.AddArgument("user-agent-Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36");


IWebDriver driver = new ChromeDriver(options);
Expand Down Expand Up @@ -117,14 +118,13 @@ private static void CaptureWebPage()
options.AddArgument("--disable-gpu");
options.AddArgument("test-type");
options.AddArgument("start-maximized");
options.AddArgument("--window-size=1280,720");
options.AddArgument("--window-size=" + W + "," + H);
options.AddArgument("test-type=browser");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--enable-precise-memory-info");
options.AddArgument("--disable-default-apps");
options.AddArguments("--disable-popup-blocking");
options.AddArgument("--headless");
options.AddArgument("user-agent-Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36");


IWebDriver driver = new ChromeDriver(options);
Expand Down
Binary file modified chromedriver.exe
Binary file not shown.

0 comments on commit 85e4e28

Please sign in to comment.