我正在使用undetected_chromedriver。

huangapple go评论63阅读模式
英文:

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()

huangapple
  • 本文由 发表于 2023年6月29日 23:04:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582307.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定