diff --git a/App.config b/App.config index 398a54e..38fcd01 100644 --- a/App.config +++ b/App.config @@ -47,6 +47,9 @@ + + + diff --git a/BMKG Windy Auto Screenshot.csproj b/BMKG Windy Auto Screenshot.csproj index 35fc970..189ad38 100644 --- a/BMKG Windy Auto Screenshot.csproj +++ b/BMKG Windy Auto Screenshot.csproj @@ -34,8 +34,8 @@ - - + + diff --git a/Program.cs b/Program.cs index 2db9f8a..e5b1054 100644 --- a/Program.cs +++ b/Program.cs @@ -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; @@ -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); @@ -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); diff --git a/chromedriver.exe b/chromedriver.exe index 1b006de..4029330 100644 Binary files a/chromedriver.exe and b/chromedriver.exe differ