Python 阻止Firefox加载项首页显示

Python 阻止Firefox加载项首页显示,python,firefox,selenium,selenium-webdriver,Python,Firefox,Selenium,Selenium Webdriver,我正在使用SeleniumWebDriverAPI编写一个Python程序,该程序利用Firefox浏览器进行浏览,我需要加载项的第一页显示它的版本被禁用,并且在浏览器开始工作时不显示。我的加载项是NoScript 以下是我的Firefox配置文件代码: def fpp(): ffprofile = webdriver.FirefoxProfile() ffprofile.add_extension(extension='NS.xpi') ffprofile.set_pr

我正在使用SeleniumWebDriverAPI编写一个Python程序,该程序利用Firefox浏览器进行浏览,我需要加载项的第一页显示它的版本被禁用,并且在浏览器开始工作时不显示。我的加载项是NoScript

以下是我的Firefox配置文件代码:

def fpp():
    ffprofile = webdriver.FirefoxProfile()
    ffprofile.add_extension(extension='NS.xpi')
    ffprofile.set_preference("extensions.noscript.currentVerison" , "2.6.9.35")
    ffprofile.update_preferences()
    return webdriver.Firefox(ffprofile)

def driver(url1):
   m = fpp()
   m.get(url1)
但是,此行不会阻止启动窗口显示:

ffprofile.set_preference("extensions.noscript.currentVerison" , "2.6.9.35")

问题是什么?如何解决它?

noscript
首选项从
noscript
开始(不需要
扩展。
)。您需要设置
版本
,而不是
当前版本
。为我工作:

ffprofile.set_preference("noscript.version", "2.6.9.35")

我按照你的建议做了,但问题仍然存在。@U潜水员好的,如果我错了,请纠正我。每次运行脚本时,您都会看到在新选项卡中打开的“noscript”欢迎页面?谢谢,没错。非常感谢你帮助我。