TA的每日心情 | 擦汗 昨天 09:07 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
Chrome headless ,无论是在命令行模式,还是代码模式下,访问https://www.maxbet.com网站,得到的html都为空
c#代码如下:
- ChromeOptions options = new ChromeOptions();
- options.AddArgument("headless");
- options.AddArgument("disable-gpu");
- options.AddArgument("no-sandbox");
- //options.AddArgument("window-size=0,0");
- //options.AddArgument("window-position=-200,-200");
- //options.AddArguments("--ignore-certificate-errors", "--disable-dev-shm-usage");
- options.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true, true);
- options.AddAdditionalCapability(CapabilityType.AcceptInsecureCertificates, true, true);
- options.AddArguments("--test-type", "--ignore-certificate-errors", "--disable-dev-shm-usage");
- options.AddUserProfilePreference("profile.default_content_setting_values.images", 2);
- var driver = new ChromeDriver(options);
- driver.Url = "https://www.maxbet.com/";
- Console.WriteLine("html:" + driver.PageSource);
- --------------------------------------------------------------------
- <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>
复制代码 在命令行模式下,使用 chrome --headless --disable-gpu --enable-logging --dump-dom https://www.maxbet.com 结果一样。知道的解答一下,谢谢。
|
|