开发者

Set Firefox >=3 to use a specific IP for all requests (NOT Proxy Server) | Used by Selenium|C#

开发者 https://www.devze.com 2023-02-21 05:01 出处:网络
I have a Windows 7 computer that hat more than one IP-Address. Now I want to set Firefox to a开发者_C百科lways use a specific IP when using Profile A. And use a specific IP when using Profile B.

I have a Windows 7 computer that hat more than one IP-Address. Now I want to set Firefox to a开发者_C百科lways use a specific IP when using Profile A. And use a specific IP when using Profile B.

How can I archieve that?

I don't want to change or set a proxy server IP. My question aims just to the fact which IP firefox uses to send all requests from.

Background:

I am coding a C# selenium App and want to use two or more firefox profiles (and windows), and all have to use a different outgoing IP.


Firefox's uses the system's preferred network adapter. As such, this behaviour is not controlled by Firefox and cannot be modified inside Firefox.

You'll need to come up with another method. For the purpose of your Selenium tests, I'd suggest writing a debug behaviour which treats the IP as a debug-specific one when detects a certain user-agent.

You can change the user-agent on your second profile by going to about:config and changing:

general.useragent.override

and

general.useragent.compatMode.firefox

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号