爬虫如何换ip
        【摘要】     ip被封是很常见的事情,首先你先有IP吧,不然怎么换 
 我在mongodb有自己的ip池,来现在教学 
resquest中换 
import requests
try: response = requests.get('http://httpbin.org/get') print(response.text)
except requests.ConnectionErr...
    
    
    
    ip被封是很常见的事情,首先你先有IP吧,不然怎么换

 我在mongodb有自己的ip池,来现在教学
resquest中换
import requests
try: response = requests.get('http://httpbin.org/get') print(response.text)
except requests.ConnectionError as e: print(e) # db.remove(ip) print("已删除")
  
 - 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 7
 - 8
 
“origin”: “120.236.84.131, 120.236.84.131”, 本机的ip
  "args": {}, "headers": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Host": "httpbin.org", "User-Agent": "python-requests/2.18.4"
  }, "origin": "120.236.84.131, 120.236.84.131", "url": "https://
  
 - 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 7
 - 8
 - 9
 
文章来源: maoli.blog.csdn.net,作者:刘润森!,版权归原作者所有,如需转载,请联系作者。
原文链接:maoli.blog.csdn.net/article/details/89342652
        【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
            cloudbbs@huaweicloud.com
        
        
        
        
        - 点赞
 - 收藏
 - 关注作者
 
            
           
评论(0)