
Hands-on teaching you to use Firefox browser hanging proxy
engaged in data collection friends should have encountered the site anti-climbing, this time the proxy IP is a lifesaver. We do not talk about the complexity of the principle, directly teach you how to use Firefox comes with the Geckodriver hanging proxy. Note ah, here said the proxy are compliant with legal purposes, such as market research, price monitoring these serious things.
Don't be lazy with your preparation.
Check that all three are loaded first:
1. Firefox browser (latest version required)
2. Python environment (3.7+ recommended)
3. Selenium library (pip install selenium will install it)
Verify that Geckodriver is working
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.ipipgo.com/ip") Here we use our own service to detect the IP.
Agent Configuration Core Code
Here's the kicker! When using ipipgo's proxy service, remember to set it up like this in the code:
from selenium.webdriver import FirefoxOptions
opts = FirefoxOptions()
opts.set_preference('network.proxy.type', 1)
opts.set_preference('network.proxy.http', 'gateway.ipipgo.com') This is where you put the extracted proxy address.
opts.set_preference('network.proxy.http_port', 30001) see the API for the specific port
opts.set_preference('network.proxy.ssl', 'gateway.ipipgo.com') This is for HTTPS sites.
opts.set_preference('network.proxy.ssl_port', 30001)
driver = webdriver.Firefox(options=opts)
Watch this space!Remember to add these two lines if you get a certificate error:
opts.set_preference('acceptInsecureCerts', True)
opts.set_preference('security.cert_pinning.enforcement_level', 0)
There's something to be said for package selection
| Business Type | Applicable Scenarios | prices |
|---|---|---|
| Dynamic residential (standard) | Routine data collection | 7.67 Yuan/GB |
| Dynamic Residential (Business) | high concurrency requirements | 9.47 Yuan/GB |
| Static homes | Long-term fixed IP | 35RMB/IP |
Frequently Asked Questions QA
Q: What should I do if the proxy doesn't take effect after I set it?
A: First manually visit ipipgo's IP detection page, if the display is still the local IP, check three points: 1. the code in the port to write or not write the wrong 2. the account balance is enough 3. extraction of the proxy is not in effect!
Q: How do I choose between dynamic and static packages?
A: need to change IP frequently choose dynamic, such as robbing monitoring; need to maintain the login state choose static, such as social media operations
Q: What should I do if my agent is slow?
A: In ipipgo background switching terminal nodes, it is recommended to choose the region of physical proximity. For example, to do Japanese e-commerce, prioritize the selection of servers in Tokyo
Guide to avoiding the pit
A common mistake newbies make:
1. Failure to turn off the browser's local proxy (conflicts with code settings)
2. Forgot to set up SSL proxy (resulting in HTTPS site can not be opened)
3. the same IP request too often (even with a proxy to control the pace)
Finally said a cold knowledge: with ipipgo's TK dedicated proxy access to certain e-commerce platforms, can be faster than ordinary proxy 30% or so. Specifically how to configure their technical customer service to find the program, anyway, 1 to 1 customized service is not used for nothing.

