#导入需要的库和模块
#根据使用的浏览器下载对应的浏览器驱动,如chromedriver,将驱动程序的路径添加到环境变量中(或指定驱动程序的路径)
# 下载需要使用的插件,将插件的路径保存到一个变量中
#指定驱动程序的路径和插件路径:
#在需要使用插件的地方进行操作,使用插件进行账号登录
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--start-maximized') # 窗口最大化
chrome_options.add_extension('D:\pythonProject\pythonProject\Scripts') # 替换为插件文件的路径
driver = webdriver.Chrome(executable='D:\pythonProject\pythonProject\Scripts', chrome_options=chrome_options)
driver.get('https://gm-portal.changyou.com/Giveaway/index')
Traceback (most recent call last):
File "D:\pythonProject\gamefish.py", line 87, in <module>
driver = webdriver.Chrome(executable='D:\pythonProject\pythonProject\Scripts', chrome_options=chrome_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable'
,这个报错是什么原因,啊,咋解决呀