3

如何向浏览器添加首选项,使其在没有 javascript 的情况下启动?

4

2 回答 2

6

Try setting firefox's profile to disable the javascript:

from selenium import webdriver

fp = webdriver.FirefoxProfile()

fp.set_preference("browser.download.folderList",2)
fp.set_preference("javascript.enabled", False)

browser = webdriver.Firefox(firefox_profile=fp)

To check in the webdriver browser if javascript is enabled do the following:

On the menubar navigate to Firefox > Preferences > Content and the check button for enable javascript should be unchecked. Like the picture shown below.

enter image description here

于 2012-12-01T01:44:37.437 回答
0

您可以直接从浏览器禁用 javascript。脚步:

  • 在 url 中输入 About:config
  • 点击我会小心的,我保证
  • 搜索 javascript.enabled
  • 右键单击->切换
  • 值 = 假
于 2015-04-29T22:20:39.457 回答