环境:Python 3.5.x + Selenium 3.4.3 + Chromedriver 2.30 + Chrome 60 beta或Chromium Canary 61 + WIN10
Chrome启用无界面浏览模式时,自定义插件是没法加载的,会报以下错误:
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to wait for extension background page to load: chrome-extension://feflpdjmifamhdhgdjabfkijbmnlhoen/_generated_background_page.html from unknown error: page could not be found: chrome-extension://feflpdjmifamhdhgdjabfkijbmnlhoen/_generated_background_page.html (Driver info: chromedriver=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 10.0.15063 x86_64)
google了很多文章,都没看到解决办法,我的自定义插件是为了连接需要密码的代理服务器,为了能正常启用无界面浏览模式又能正常使用代理,可以考虑用ProxyCap或Proxifier,经测试Proxifier在连香港代理时老是出现偶尔连不上的问题,而ProxyCap却正常,DNS都是设置从远程服务器上解析。