python - 在 Selenium Firefox 中将默认设置设置为 'no proxy'

标签 python selenium proxy

每当我使用命令在 python 中使用 Selenium 打开 Firefox

browser = webdriver.Firefox()

默认代理配置设置为“使用系统代理设置”。我没有在系统中配置任何代理。尽管如此,每当浏览器打开时,它都会显示“代理服务器拒绝连接”。

如何打开浏览器,将默认代理设置设置为“无代理”?

请帮忙。提前致谢。

最佳答案

我会根据我的内存发布

import os
from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.set_preference('network.proxy.Kind','Direct')
webdriver.Firefox(profile)

要使用默认配置文件,您必须指定它

profile = webdriver.FirefoxProfile(path_to_profile_in_your_pc)
webdriver.Firefox(profile)

关于python - 在 Selenium Firefox 中将默认设置设置为 'no proxy',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36129565/

相关文章:

python - 将 numpy 安装到目录后,AWS Lambda 中缺少必需的依赖项 ['numpy' ],如何修复?

Python正则表达式模块模糊匹配: substitution count not as expected

python - 导入错误 : DLL load failed while importing _rolling_ball_cy:

C++ 代理 DLL(64 位)

Haskell 代理发布请求

python - Selenium Python 无法在 ConnectWise 登录页面上选择元素

python - 无法单击下拉列表 Selenium 中的选项

python - 如何抓取 HTML 表格格式的数据?

java - 如何使用 WebDriver for Java 选择动态号码链接

python - Python 脚本、代理和 Microsoft Forefront - 自动身份验证