xxm8023 发表于 2022-11-7 12:02:11

python selenium 问题

from selenium import webdriver
import time

url = 'https://www.baidu.com'

# 设置无界面模型
option = webdriver.FirefoxOptions()
option.add_argument('--headless')

driver = webdriver.Firefox(firefox_options=option, executable_path='/usr/local/bin/geckodriver')
driver.get(url)

print(driver.title)

报错如下

灰晨 发表于 2022-11-7 17:16:00

webdriver.Firefox(firefox_options=option
没有firefox_options
改options
页: [1]
查看完整版本: python selenium 问题