public IWebDriver GetWebDriver()
{
/*********************使用火狐浏览器*********************/
FirefoxOptions options = new FirefoxOptions();
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
FirefoxProfile profile = new FirefoxProfile();
//设置页面加载完成状态
options.PageLoadStrategy = OpenQA.Selenium.PageLoadStrategy.Eager;
//设置浏览器路径
options.BrowserExecutableLocation = @"browser\firefox.exe";
//关闭每次调试时打开的CMD
service.HideCommandPromptWindow = true;
//禁止GPU渲染
options.AddArgument
webdriver 火狐firefox 谷歌chrome浏览器启动参数设置 反爬代码
最新推荐文章于 2024-05-16 10:45:17 发布