Selenium不获取url(3行python)



使用 chrome 76.0.3809.132和 chromedriver 76.0.3809.126 测试浏览器打开,但会抛出driver.get回溯。它无法提取页面。

尝试了几个论点,并尝试寻找带有较旧 chrome 驱动程序的旧版 Chrome,这似乎是不可能的。

from selenium import webdriver
driver = webdriver.Chrome("C:/chromedriver/chromedriver.exe")
driver.get("www.google.com")

输出:

DevTools listening on ws://127.0.0.1:57577/devtools/browser/7494ca24-60fb-4b14-9aed-4f25232b94bd
Traceback (most recent call last):
File "slidingwindow.py", line 5, in <module>
driver.get("www.google.com")
File "C:projectspythonharvesterlibsite-packagesseleniumwebdriverremotewebdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "C:projectspythonharvesterlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute       
self.error_handler.check_response(response)
File "C:projectspythonharvesterlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument   (Session info: chrome=76.0.3809.132)

尝试插入 https://:

from selenium import webdriver
driver = webdriver.Chrome(executable_path="chromedriver.exe")
driver.get("https://www.google.com")

相关内容

  • 没有找到相关文章

最新更新