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)
相关推荐
wangchen_01 分钟前
C/C++时间操作(ctime、chrono)
开发语言·c++
Dev7z13 分钟前
基于MATLAB HSI颜色空间的图像美颜系统设计与实现
开发语言·matlab
superman超哥14 分钟前
仓颉语言中字符串常用方法的深度剖析与工程实践
开发语言·后端·python·c#·仓颉
癫狂的兔子24 分钟前
【BUG】【Python】精确度问题
python·bug
想学后端的前端工程师30 分钟前
【Spring Boot微服务开发实战:从入门到企业级应用】
java·开发语言·python
刺客xs30 分钟前
TCP网络通信
网络·网络协议·tcp/ip
刺客-Andy36 分钟前
js高频面试题 50道及答案
开发语言·javascript·ecmascript
夏幻灵42 分钟前
指针在 C++ 中最核心、最实用的两个作用:“避免大数据的复制” 和 “共享”。
开发语言·c++
ghie90901 小时前
MATLAB 高速公路裂缝检测
开发语言·matlab
Yyyyy123jsjs1 小时前
Python 如何做量化交易?从行情获取开始
开发语言·python