设置firefox某个网段不使用代理

某个网段不使用代理的设置FF和IE不同,IE是用*通配符,FF是用CIDR的表示法,  

FF的简单设置方法如下(以192网段为例,你可以改为你的所屏蔽的IP数字):  

如果屏蔽192.0.0.0 - 192.255.255.255 就这样设置 192.0.0.0/8  
如果屏蔽192.168.0.0 - 192.168.255.255 这样设置 192.168.0.0/16  
如果屏蔽192.168.1.0 - 192.168.1.255 这样设置 192.168.1.0/24  

IP地址是用32Bit表示的,/后面的数字(范围为1-32)表示mask的IP段,
如/8 表示mask的ip地址的8Bit后面的IP段,即 xxx.0.0.0 - xxx.255.255.255 这个IP段。
又如屏蔽10.128.0.0 - 10.255.255.255(9比特后面为mask的IP段) , 就可以设置成10.128.0.0/9 ,
用通配符就无法表示了。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Java中使用Selenium和Firefox浏览器进行代理设置,可以按照以下步骤进行: 1. 下载Firefox浏览器,并安装FoxyProxy Standard插件。 2. 配置FoxyProxy,添加代理服务器地址和端口号,并选择“HTTP代理”类型。 3. 在FoxyProxy的“身份验证”选项卡中,填写代理服务器的用户名和密码,保存设置。 4. 在Java中使用Selenium启动Firefox浏览器,并使用FirefoxProfile设置代理服务器。 5. 在Firefox浏览器中访问需要使用代理服务器的网站,即可自动使用设置好的代理服务器进行访问。 下面是一个示例代码: ``` import org.openqa.selenium.Proxy; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; // 创建FirefoxProfile对象 FirefoxProfile firefoxProfile = new FirefoxProfile(); // 设置代理服务器地址和端口号 String proxyUrl = "http://proxy.server.com:port"; firefoxProfile.setPreference("network.proxy.type", 1); firefoxProfile.setPreference("network.proxy.http", proxyUrl); firefoxProfile.setPreference("network.proxy.http_port", 80); // 设置代理服务器的用户名和密码 String proxyUsername = "username"; String proxyPassword = "password"; firefoxProfile.setPreference("extensions.foxyproxy.proxyPassword", proxyPassword); firefoxProfile.setPreference("extensions.foxyproxy.proxyUsername", proxyUsername); // 启动Firefox浏览器 DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(CapabilityType.PROXY, new Proxy().setHttpProxy(proxyUrl)); WebDriver driver = new FirefoxDriver(capabilities); // 访问需要使用代理服务器的网站 driver.get("https://www.example.com"); ``` 通过以上代码,就可以在Java中使用Selenium和Firefox浏览器进行代理设置。注意,这里使用了FoxyProxy插件设置代理服务器的账号密码,且在Java代码中设置FirefoxProfile和DesiredCapabilities,来启动Firefox浏览器并设置代理服务器。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值