英文:
How to run Webdriver headless with Chrome profiles
问题
我已经使用Chrome配置文件成功登录了一个网站... 但是希望浏览器不要显示出来,所以我在此之后添加了options.addArguments("user-data-dir=" + myProfilesPath);
,但是之后它就不起作用了!请告诉我为什么无头参数与配置文件一起使用时不起作用?我该如何解决这个问题?
英文:
I have been use Chrome profiles to login a website it was success...! But want to browser not showing up so I added options.addArguments("user-data-dir="+myProfilesPath);
after then it not working! Plzz tell me why headless argument not working with profiles? And How do I solve that problem?
答案1
得分: 0
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
英文:
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
专注分享java语言的经验与见解,让所有开发者获益!
评论