英文:
I am using undetected_chromedriver
问题
I am using undetected_chromedriver
, but I am getting the error:
This version of ChromeDriver only supports Chrome version 114
Current browser version is 103.0.5060.53
我的代码:
import undetected_chromedriver as uc
uc.TARGET_VERSION = 103
options = uc.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = uc.Chrome(options=options, version_main=103, patcher_force_close=True)
driver.get('https://nowsecure.nl')
driver.quit()
英文:
I am using undetected_chromedriver
, but I am getting the error
This version of ChromeDriver only supports Chrome version 114
Current browser version is 103.0.5060.53
My code:
import undetected_chromedriver as uc
uc.TARGET_VERSION = 103
options = uc.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = uc.Chrome(options=options, version_main=103, patcher_force_close=True)
driver.get('https://nowsecure.nl')
driver.quit()
答案1
得分: 1
你可以使用SeleniumBase的UC模式来使用未检测到的chromedriver与任何浏览器版本(如果缺失,它会自动下载正确的驱动程序)。
首先使用pip install seleniumbase
进行安装,然后使用python
运行以下脚本:
from seleniumbase import Driver
import time
driver = Driver(uc=True, incognito=True)
driver.get("https://nowsecure.nl/#relax")
time.sleep(8)
driver.quit()
英文:
You can use SeleniumBase's UC Mode to use undetected-chromedriver with any browser version (it automatically downloads the correct driver if missing).
First pip install seleniumbase
, and then run the following script with python
:
from seleniumbase import Driver
import time
driver = Driver(uc=True, incognito=True)
driver.get("https://nowsecure.nl/#relax")
time.sleep(8)
driver.quit()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论