Chrome headless 下访问maxbet(https网站),显示错误,不知道是不是证书原因

weixin_41260140 2019-08-01 09:38:08
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 结果一样。知道的解答一下,谢谢。
...全文
128 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,219

社区成员

发帖
与我相关
我的任务
社区描述
软件工程/管理 质量管理/软件测试
功能测试压力测试安全性测试 个人社区 湖南省·长沙市
社区管理员
  • 软件测试
  • 虫无涯
  • 小博测试成长之路
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

欢迎大家加入到软件测试的社区,在这里,希望大家勇于发表自己的看法,欢迎大家分享自己在软件测试工作过程中遇到的问题以及工作经验分享。

1.想转行的小伙伴,遇到问题没有及时回复的,可以私聊小博进行反馈

2.大家对社区有好的建议,都可以在社区发帖进行反馈

推荐大家学习的软件测试入门笔记:软件测试入门学习笔记

试试用AI创作助手写篇文章吧