在使用模拟加载页面操作时,谷歌浏览器升级了,你的模拟用不了了,这时候需要下载相对应的驱动,很多情况找不到下载地址,下面两个地址够用了,遇到这种问题,可以查看。

http://chromedriver.storage.googleapis.com/index.html

http://googlechromelabs.github.io/chrome-for-testing/

var DRIVER  = require('selenium-webdriver');
var profile = DRIVER.Capabilities.chrome();
profile.set( 'browserName', 'chrome' );
profile.set('chromeOptions', {
       'headless': true,
      'args' : ['--lang=EN', '--disable-popup-blocking', '--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36' ]
});
var BUILDER = new DRIVER.Builder().withCapabilities( profile );
var BROWSER = BUILDER.build();

针对上面这种模式使用方式,puppeteer使用方式可以忽略。

本站无任何商业行为
个人在线分享 » 谷歌webdriver下载地址
E-->