爬虫如何换ip
发布日期:2021-07-01 02:12:49 浏览次数:2 分类:技术文章

本文共 517 字,大约阅读时间需要 1 分钟。

ip被封是很常见的事情,首先你先有IP吧,不然怎么换

在这里插入图片描述

我在mongodb有自己的ip池,来现在教学

resquest中换

import requeststry:    response = requests.get('http://httpbin.org/get')    print(response.text)except requests.ConnectionError as e:    print(e)    # db.remove(ip)    print("已删除")

“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://

转载地址:https://maoli.blog.csdn.net/article/details/89342652 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:四十八、Python中的GUI布局tkinter
下一篇:五、Requests库详细的用法

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月20日 18时25分11秒