1
如何停用WebRTC檢測在Firefox 「media.peerconnection.enabled」 使用硒的webdriver硒的webdriver停用WebRTC檢測在Firefox profile.setpreference
這是代碼
from selenium.webdriver.common.proxy import *
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from time import sleep
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", tax)
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.http", "xx.xx.xx.xx")
profile.set_preference("network.proxy.http_port", 3128)
profile.set_preference("media.peerconnection.enabled", "false")
profile.update_preferences()
driver = webdriver.Firefox(profile)
driver.implicitly_wait(10)
print "url: "
driver.get('http://www.example.com')
的profile.set_preference(「media.peerconnection.enabled」,「false」)只有在我手動設置的情況下才起作用 Selenium如何做到這一點