标签:print port res color word user log style code
1 import requests 2 3 proxies={ 4 ‘http‘:‘http://192.168.1.1:88‘ 5 ‘https‘:‘https://192.168.1.1:88‘ 6 #如果代理ip需要用户名和密码的话 ‘http‘:‘user:password@192.168.1.1:88‘ 7 } 8 response = requests.get(url,proxies=proxies) 9 print(response.status_code) 10 11 #如果代理类型不是http或者https,而是socks代理 12 #需要先 pip3 install ‘requests[socks] 13 proxies={ 14 ‘http‘:‘socks5://192.168.1.1:88‘ 15 ‘https‘:‘socks5://192.168.1.1:88‘ 16 #如果代理ip需要用户名和密码的话 ‘http‘:‘user:password@192.168.1.1:88‘ 17 }
标签:print port res color word user log style code
原文地址:http://www.cnblogs.com/themost/p/6843428.html