TypeError: get()缺少1个必需的位置参数:’url’

huangapple go评论147阅读模式
英文:

TypeError: get() missing 1 required positional argument: 'url'

问题

Error:

TypeError: get() missing 1 required positional argument: 'url'

如何解决?谢谢

英文:

Executing below code:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
browser  = webdriver.Chrome

browser.get('https://soysocio.bocajuniors.com.ar/index.php')

Error:

TypeError: get() missing 1 required positional argument: 'url'

How can i solve it? Thank you

答案1

得分: 1

你应该将 webdriver.Chrome 更改为 webdriver.Chrome()

Chrome 是一个类,而不是一个实例。

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
browser = webdriver.Chrome()

browser.get('https://soysocio.bocajuniors.com.ar/index.php')
英文:

you should change webdriver.Chrome to webdriver.Chrome()

Chrome is a class, not an instance.

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
browser  = webdriver.Chrome()

browser.get('https://soysocio.bocajuniors.com.ar/index.php')

答案2

得分: 0

你忘记执行 Chrome 驱动程序。

browser = webdriver.Chrome('/path/to/chromedriver') # 可选参数,如果未指定,将搜索路径。

您可以在这里找到如何使用 Chrome 驱动程序的示例。

英文:

You forgot to execute the Chrome driver.

browser = webdriver.Chrome('/path/to/chromedriver') # Optional argument, if not specified will search path.

You can find examples of how Chrome driver used here

答案3

得分: 0

browser = webdriver.Chrome
browser应该被实例化

browser = webdriver.Chrome()

英文:
browser  = webdriver.Chrome

browser should be instantiation

browser  = webdriver.Chrome()

huangapple
  • 本文由 发表于 2023年6月29日 11:09:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76577840.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定