在Firefox中设置http代理

大家早安,晚上

运行脚本时,我试图设置HTTP代理。我将使用此代码,但会收到错误消息。

我的代码:

from selenium import webdriver
import time
profile = webdriver.FirefoxProfile()
profile.set_preference('network.proxy_type',1)
profile.set_preference('network.proxy.http',"179.50.10.187")
profile.set_preference('network.proxy.http_port',3128)
profile.update_preference()

driver=webdriver.Firefox(firefox_profile=profile)
drivre.get('http://whatismyipadress.com')
time.sleep(10)`

,错误是:

  
traceback (most recent call last):
   File "task.py",line 8,in <module>
     profile.update_preference()
 AttributeError: 'FirefoxProfile' object has no attribute 'update_preference`

我该怎么办?谢谢您的回答。

Reakie2008 回答:在Firefox中设置http代理

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3148210.html

大家都在问