【问题标题】:Setting default setting to 'no proxy' in Selenium Firefox在 Selenium Firefox 中将默认设置设置为“无代理”
【发布时间】:2016-03-21 11:15:02
【问题描述】:

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

browser = webdriver.Firefox()

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

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

请帮忙。提前致谢。

【问题讨论】:

    标签: python selenium proxy


    【解决方案1】:

    我会根据我的记忆发帖

    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)
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-07
    • 1970-01-01
    • 2010-10-12
    • 1970-01-01
    • 2015-07-29
    • 1970-01-01
    • 2021-12-22
    • 1970-01-01
    相关资源
    最近更新 更多