空控制台输出Python
我添加并使用了Undetected_chromedriver库,此后该程序停止工作。我做错了吗? 在控制台中没有写任何东西
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium import webdriver
import undetected_chromedriver as uc
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
service = Service(executable_path="path")
driver = uc.Chrome(options=options, service=service)
driver.get("link")
接下来是该程序的代码,但是效果很好
I added and used undetected_chromedriver library, and after that the program stopped working. Did I do something wrong? Nothing is written in the console
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium import webdriver
import undetected_chromedriver as uc
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
service = Service(executable_path="path")
driver = uc.Chrome(options=options, service=service)
driver.get("link")
Next comes the code of the program, but it worked well
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信在较新的UC版本中,它带有Chromeoptions,因此您无需使用硒。
I believe in the newer version of uc it comes with chromeoptions so you don't need to use selenium.
我从来没有弄清楚这些选择,但是问题在于路径。您需要使用
driver_executable_path =“”
。并添加模块导入检查如果__name__ =='__ main __':
,然后将所有代码放在那里。现在该程序看起来像这样:I never figured out the options, but the problem was with the path. You need to use
driver_executable_path=""
. And add the module import checkif __name__ == '__main__':
, and put all the code there. Now the program looks like this: