我有一些网络抓取脚本,但现在它不起作用。我在这些方面遇到错误:
from selenium import webdriver
driver = webdriver.Chrome()
我明白了:
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
我尝试重新安装Chrome,使用最新版本的chromedriver,但它仍然无法正常工作。 有人能帮助我吗?
谢谢
答案 0 :(得分:0)
试
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--screen-size=1920X1080')
driver = webdriver.Chrome('your_chrome_patch/chromedriver',chrome_options=chrome_options)
driver.get(url)