python的requests爬虫模块使用代理ip方法---集合

形式一

python 复制代码
import requests
proxies = {'http':'128.3.74.224:2890','https':'128.3.74.224:2890'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)

形式二

形式一不行的情况下,试试形式二

python 复制代码
import requests
proxies = {'http':'http://127.0.0.1:7890','https':'https://127.0.0.1:7890'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)

形式三

带有账号密码的使用方法

python 复制代码
import requests
proxies = {'http':'user123:psw123@43.xxx.xxx.113:10801','https':'user123:psw123@43.xxx.xxx.113:10801'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)
相关推荐
tang&43 分钟前
【Python自动化测试】Selenium常用函数详解
开发语言·python·selenium
卜锦元2 小时前
Golang项目开发过程中好用的包整理归纳(附带不同包仓库地址)
开发语言·后端·golang
Tony Bai6 小时前
“我曾想付钱给 Google 去工作”—— Russ Cox 深度访谈:Go 的诞生、演进与未来
开发语言·后端·golang
sali-tec6 小时前
C# 基于halcon的视觉工作流-章66 四目匹配
开发语言·人工智能·数码相机·算法·计算机视觉·c#
路边草随风6 小时前
milvus向量数据库使用尝试
人工智能·python·milvus
hnlgzb6 小时前
安卓app开发,如何快速上手kotlin和compose的开发?
android·开发语言·kotlin
newobut6 小时前
vscode远程调试python程序,基于debugpy库
vscode·python·调试·debugpy
无敌最俊朗@7 小时前
STL-deque面试剖析(面试复习4)
开发语言
APIshop7 小时前
用 Python 把“API 接口”当数据源——从找口子到落库的全流程实战
开发语言·python
Java Fans7 小时前
Qt Designer 和 PyQt 开发教程
开发语言·qt·pyqt