51Testing软件测试论坛
标题:
Chrome headless 下访问maxbet(https网站),显示错误,不知道是不是证书原因
[打印本页]
作者:
测试积点老人
时间:
2019-8-13 09:34
标题:
Chrome headless 下访问maxbet(https网站),显示错误,不知道是不是证书原因
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
结果一样。知道的解答一下,谢谢。
作者:
海海豚
时间:
2019-8-14 10:13
应该是证书的问题
作者:
qqq911
时间:
2019-8-14 10:42
贴下日志
作者:
jingzizx
时间:
2019-8-14 13:03
试试其他方式
作者:
104~牛牛
时间:
2019-8-14 15:26
fiddler试试
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2