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 结果一样。知道的解答一下,谢谢。
应该是证书的问题 贴下日志 试试其他方式
fiddler试试
页:
[1]