1
期間更改代理服務器所以一切工作硒
fp = webdriver.FirefoxProfile()
fp.set_preference("network.proxy.type", 1)
fp.set_preference("network.proxy.http", PROXY_HOST)
fp.set_preference("network.proxy.http_port", int(PROXY_PORT))
fp.update_preferences()
driver = webdriver.Firefox(firefox_profile=fp)
但如果驅動程序已經創建,代理無法安裝。 它不起作用
driver = webdriver.Firefox()
driver.profile.set_preference("network.proxy.type", 1)
driver.profile.set_preference("network.proxy.http", PROXY_HOST)
driver.profile.set_preference("network.proxy.http_port", int(PROXY_PORT))
driver.profile.update_preferences()
也是如此。
driver = webdriver.Firefox()
driver.firefox_profile.set_preference("network.proxy.type", 1)
driver.firefox_profile.set_preference("network.proxy.http", PROXY_HOST)
driver.firefox_profile.set_preference("network.proxy.http_port", int(PROXY_PORT))
driver.firefox_profile.update_preferences()
爲什麼?不能理解。 我做錯了什麼?
您是否收到錯誤訊息?如果是這樣,哪一個?網絡驅動程序是否忽略您的新代理設置? –
編號沒有錯誤。一切工作正常。但是這些設置不適用。 –