Reputation: 31
I'm writing a software which visits a website and saves a screenshot as well as the innerHTML. When visiting phishing-sites, Google Chrome's Safe browsing warning shall be saved as well. But when I navigate to the phishing test page of https://testsafebrowsing.appspot.com/, I can't parse innerHTML. I also tried to simply send STRG-A and STRG-C, but this doesn't work neither.
Do you have any idea on this? I just don't get the contents of the warning page..
code snippet:
opt.AddUserProfilePreference("download.prompt_for_download", true);
opt.AddUserProfilePreference("profile.default_content_settings.popups", false);
opt.AddArguments("--user-data-dir="+Environment.ExpandEnvironmentVariables("%USERPROFILE%\\Appdata\\Local\\Google\\Chrome\\User Data"));
opt.AddArguments("disable-infobars"); automatic"
opt.AddArgument("no-sandbox");
ChromeDriver driver = new ChromeDriver(opt);
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(20);
string url = "https://testsafebrowsing.appspot.com/s/phishing.html"
driver.Navigate().GoToUrl(url);
string html = driver.PageSource;
File.WriteAllText(fileName, html);
Upvotes: 2
Views: 408
Reputation: 31
Thanks to Kiril S. my problem is solved - the Request is shown as "pending" - so I just tried to parse the driver.Url, which shows the currently active URL - in this case the page I visited before. This is enough for my use case. Thanks ;-)
Upvotes: 1