Python 试图用Selenium创建web自动工具,但该网站赢了';t载荷
我正在尝试为办公目的构建一个基本的web自动化工具。 我遵循了一些指南,至少能够获取脚本来检测驱动程序并打开浏览器Python 试图用Selenium创建web自动工具,但该网站赢了';t载荷,python,python-3.x,selenium,selenium-chromedriver,browser-automation,Python,Python 3.x,Selenium,Selenium Chromedriver,Browser Automation,我正在尝试为办公目的构建一个基本的web自动化工具。 我遵循了一些指南,至少能够获取脚本来检测驱动程序并打开浏览器 from selenium import webdriver driver = webdriver.Chrome('/home/ava/Webautomator/chromedriver') #filepath of the driver driver.get("www.google.com") 但是,在尝试加载“google.com”时,我遇到以下错误: Traceback
from selenium import webdriver
driver = webdriver.Chrome('/home/ava/Webautomator/chromedriver') #filepath of the driver
driver.get("www.google.com")
但是,在尝试加载“google.com”时,我遇到以下错误:
Traceback (most recent call last):
File "webautomator2.py", line 4, in <module>
driver.get("www.google.com")
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
(Session info: chrome=80.0.3987.87)
回溯(最近一次呼叫最后一次):
文件“webautomator2.py”,第4行,在
driver.get(“www.google.com”)
get中的文件“/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py”,第333行
self.execute(Command.GET,{'url':url})
文件“/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py”,执行中第321行
self.error\u handler.check\u响应(响应)
文件“/usr/local/lib/python3.6/dist packages/selenium/webdriver/remote/errorhandler.py”,第242行,在check_响应中
引发异常类(消息、屏幕、堆栈跟踪)
selenium.common.exceptions.InvalidArgumentException:消息:参数无效
(会话信息:chrome=80.0.3987.87)
有人知道如何修复此错误吗?请更改此错误
driver.get("www.google.com")
对此
driver.get("https://www.google.com")
改变这个
driver.get("www.google.com")
对此
driver.get("https://www.google.com")
请在url中使用https,这将解决您的问题。请在url中使用https,这将解决您的问题。