from selenium import webdriver from selenium.webdriver.chrome.service import Service try: # browser = webdriver.Chrome('/opt/apps/cn.google.chrome/files/chromedriver') s = Service(r"/opt/apps/cn.google.chrome/files/chrome") driver = webdriver.Chrome(service=s) driver.get('https://www.baidu.com') except Exception as e: print(e)
运行这个代码时,报错,需要去本地找到chrome文件,然后把chromedriver放到该目录下
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)