m0_68495459 2023-08-31 09:56 采纳率: 0%
浏览 342

TypeError: WebDriver.__init__() got multiple values for argument 'executable_path'



from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--start-maximized')
options.add_extension('D:\小狐狸钱包插件')
ph = 'D:\pythonProject\pythonProject\Scripts'

driver = webdriver.Chrome(executable_path='ph', options=Options)
driver.get('https://gm-portal.changyou.com/Giveaway/index')

#报错信息
Traceback (most recent call last):
  File "D:\pythonProject\gamefish.py", line 93, in <module>
    driver = webdriver.Chrome(executable_path='ph')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: WebDriver.__init__() got multiple values for argument 'executable_path'

为什么报这个错,

  • 写回答

2条回答 默认 最新

  • He_xj 2023-08-31 12:43
    关注

    你把参数ph的引号去掉试试

    评论

报告相同问题?

问题事件

  • 创建了问题 8月31日