AttributeError:"FirefoxProfile"对象通过Selenium和Python使用FirefoxProfile没有属性“更新"错误 [英] AttributeError: 'FirefoxProfile' object has no attribute 'update' error usingFirefoxProfile through Selenium and Python
本文介绍了AttributeError:"FirefoxProfile"对象通过Selenium和Python使用FirefoxProfile没有属性“更新"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我的代码有问题.
Hello Guys I'm having problem on my code.
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'
我想不出我只想保存配置文件设置以供使用的问题.
I cant figure out the problem i just want to save the profile settings to use.
推荐答案
我认为您需要对此进行更改
I Think You Need To Change This
profile.update_preference()
与此:
profile.update_preferences()
这篇关于AttributeError:"FirefoxProfile"对象通过Selenium和Python使用FirefoxProfile没有属性“更新"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文