This paper is written by A little fool Typing Code Y original
The learning column recommends :Unity Systematic learning column
Recommended in the game production column : Game making
Unity actual combat 100 Example column recommendation :Unity actual combat 100 example course
Welcome to thumb up Collection Leaving a message. Please correct any mistakes !
The future is long , It's worth our effort to go to a better life
------------------️ Split line ️-------------------------
@toc
A dynamic proxy IP, Literally, this IP Will change randomly at any time , Not fixed , It's a dynamic agent IP. A dynamic proxy IP Generally, there will be web crawler users to use .
dynamic IP It is divided into Long term agent and Short acting agent :
Long term agent IP: It supports many businesses such as data collection or game hanging up , Due to the large amount of data collected by web crawlers , Rarely choose long-term agents , Long term agent IP It's equivalent to local IP equally , It's natural to visit a website for a long time IP Will also be limited , And the amount of collection is very small . It's not good for reptiles to use .
Short acting agent IP: Support data capture 、seo Optimize 、 APP Brush quantity , Q & a promotion and many other businesses . Generally, web crawler users choose dynamic short acting agents IP More of them . The business volume of reptiles is large , Use dynamic short acting agents IP To collect data , Can greatly improve business efficiency .
A dynamic proxy IP It's also divided into Transparent proxy , Anonymous proxy , High hiding agent .
This shows that the agent IP The mass strength of . For web crawlers, they can purchase and customize according to their own needs IP.
High hiding agent Nature is also a dynamic agent IP The best quality of the type , Many enterprise crawler users will choose the high hidden crawler agent for tunnel forwarding IP To provide business needs , Ensure your business effectiveness and quality .
Transparent proxy and Anonymous proxy Although it is also an agent IP, But greatly reduce the progress and efficiency of the crawler business , Therefore, the crawler agent that the web crawler chooses for tunnel forwarding is the correct choice .
A brief introduction to dynamic agent IP The concept and benefits of , Let's talk about how to apply for this A dynamic proxy IP .
What I use here is IPIDEA This website , Now new users have 500M Traffic white whoring , Just so we can experiment with it .
You can just click Register :http://www.ipidea.net/?utm-source=csdn&utm-keyword=?xy
After entering the website, click Access to the agent -> API obtain
Then choose according to your preferences Number and region , For others, use the default options , Then click below Generate links
If there is no real name authentication, this interface will pop up , Just click Authentication
Then copy the link we generated , This link should be saved , Use... In the back Python When climbing, you will use .
Copy the link separately and then open it. You will see the generated IP, This part can be used for manual setting of our own browser .
As mentioned above , The present agent ip There are many websites , How to choose the right platform is also a question worth thinking about .
Because there are many agents at present IP Website , according to stability and Security The comparison price is very different .
IPIDEA New users will get some free traffic when they register , This is important for us to try using agents ip Very friendly to my little partner .
Also, the platform supports residential dynamics ip, It's also an advantage .
Dynamic housing IP The benefits of :
agent ip There are many ways to use , Now I will use and use the generated... Directly in the browser API Link two ways to make a simple demonstration .
In the last step, we got a ip Agent pool , Next take QQ browser Example , Take a quick look at how to use these agents ip.
stay QQ Browser menu list - Set up - senior - The Internet - Change proxy settings
In the pop-up Internet Properties window , Click on LAN settings
Fill in the... We copied IP and Port number , And click the determine
Open the baidu / Google search engine , Search for :IP, View the status of the current agent IP Address
Here we are successful in using agent ip 了 , Next use The agent ip You can do something else ~
If you want to see more configuration methods of different browsers, you can go to IPIDEA The website links see
Be careful : It can only be used in overseas network environment , Do not provide any form of domestic use .
But this is just the simplest use , More advanced is to use this dynamic when using crawlers IP The agent pool achieves a better effect .
Let's write a simple proxy ip To visit github python Examples of modules .
Use Python Write a simple ip agent Example , Use... In the back Python When climbing some other data, you can refer to .
Use it directly requests
Module to do , Then add a random request header module fake_useragent
and UserAgent
.
The following is to github python modular Make a simple example , The interface is as follows :
The full code is shown below , The notes are very detailed , I won't elaborate on it .
# WeChat search :[ A little fool Typing Code Y], reply [ Whoring for nothing ] Get more excellent programming learning materials !!# Crawlers use proxies IP# The import module :requests、fake-useragent、UserAgentimport requestsfrom fake_useragent import UserAgent# To visit url Address url='https://github.com/search?q=python'# Random request header headers={'User-Agent':UserAgent().random}# agent ip Of API(IPIDEA From the website )api_url='http://tiqu.ipidea.io:81/abroad?num=100&type=1&lb=1&sb=0&flow=1®ions=&port=1'res = requests.post(api_url,headers=headers, verify=True)# proxies = {' agreement ': ' agreement ://IP: Port number '}proxie = "https://%s"%(res.text)proxies = {'http': proxie}# Print all agents ipprint(proxies)# visit github python Module test and output results html=requests.get(url=url,headers=headers,proxies=proxies).textprint(html)# WeChat search :[ A little fool Typing Code Y], reply [ Whoring for nothing ] Get more excellent programming learning materials !!
The operation effect is shown in :
This is just a demonstration of using agent ip Crawling away github python modular , Make good use of A dynamic proxy ip There are more things that can be used , Let's experience it by ourselves !
As long as you can use reptiles , We can customize an automatic time switch ip, In this way, when crawling a large amount of data, it will avoid restricted access , Improve reptile efficiency .