Python 2.7 如何覆盖selenium firefox概要文件中的buid id、供应商名称详细信息-Python

Python 2.7 如何覆盖selenium firefox概要文件中的buid id、供应商名称详细信息-Python,python-2.7,firefox,selenium,Python 2.7,Firefox,Selenium,我需要在selenium Firefox配置文件中覆盖一些细节,如应用程序版本、buld id、供应商名称,以避免浏览器指纹。我尝试了以下代码,但不起作用,请有人帮助我解决此问题。Firefox版本:38.6.1,selenium:2.52,OS:mac # coding=utf-8 #!/usr/bin/python # -*- coding: utf-8-*- from selenium import webdriver import json import os from selenium

我需要在selenium Firefox配置文件中覆盖一些细节,如应用程序版本、buld id、供应商名称,以避免浏览器指纹。我尝试了以下代码,但不起作用,请有人帮助我解决此问题。Firefox版本:38.6.1,selenium:2.52,OS:mac

# coding=utf-8
#!/usr/bin/python
# -*- coding: utf-8-*-
from selenium import webdriver
import json
import os
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile

firefoxProfile = FirefoxProfile()
firefoxProfile.set_preference('general.platform.override','test_platform_info')
firefoxProfile.set_preference('general.appversion.override','test_app_version_in')
firefoxProfile.set_preference("general.productSub.override", 'test_sub')
firefoxProfile.set_preference("general.buildID.override", 'test_build_info')
firefoxProfile.set_preference('general.useragent.vendor', 'bla')
firefoxProfile.update_preferences()
driver = webdriver.Firefox(firefoxProfile)
driver.get("https://www.browserleaks.com/javascript#further-reading")
预期结果:

Build ID : test_build_info
Product Sub : test_sub
Vendor : bla
当前结果:

Build ID : xxxxxxx
Product Sub : xxxxxx
Vendor : empty