selenium headless报错Message: unknown error: failed to wait for extension background page to load

selenium进行打开chrome浏览器操作时报错。

完整报错:

selenium.common.exceptions.WebDriverException: Message: unknown error: failed to wait for extension background page to load: chrome-extension://jppfbclhbammkjacehdkldjfgminfgca/_generated_background_page.html
from unknown error: page could not be found: chrome-extension://jppfbclhbammkjacehdkldjfgminfgca/_generated_background_page.html

原因:chrome headless无头浏览器不支持chrome-extension,至今没有解决…

解决方式:取消headless无头设置

注释掉以下设置:
chrome_options.add_argument('--headless')

 

posted @ 2023-06-17 13:51  江东邮差  阅读(64)  评论(0编辑  收藏  举报