【发布时间】:2019-11-28 11:00:20
【问题描述】:
大家好,我的代码有问题。
from selenium import webdriver
import time
profile = webdriver.FirefoxProfile()
profile.set_preference('network.proxy_type',1)
profile.set_preference('network.proxy.http',"91.xx.xxx.xx")
profile.set_preference('network.proxy.http_port',xxxx)
# profile.update_preference() ---> this code letter giving the error.
driver = webdriver.Firefox(firefox_profile=profile)
driver.get('http://whatismyipaddress.com')
time.sleep(3)
driver.close()
这是我遇到的错误:
AttributeError: 'FirefoxProfile' object has no attribute 'update'
我无法弄清楚我只想保存配置文件设置以供使用的问题。
【问题讨论】:
-
update_preferences(),与s。
标签: python selenium selenium-webdriver firefox firefox-profile