当前位置:网站首页>代理服务器
代理服务器
2022-04-23 05:47:00 【峰爷520】
l = [
'106.39.179.236:80',
'23.94.191.219:1080',
'121.41.175.199:80',
'122.183.139.98:8080',
'118.193.107.182:80',
'92.42.109.45:1080',
'128.199.77.93:8080',
'46.101.60.239:8118',
'185.106.121.98:1080',
'185.82.203.81:1080',
'112.114.93.27:8118',
'104.131.69.203:80',
'138.201.0.184:1080',
'46.101.46.174:8118',
'178.62.123.38:8118',
'217.23.15.193:1080',
'60.168.207.208:8010',
'139.59.170.110:8118',
'223.241.118.228:8010',
'123.192.114.113:80',
'103.37.95.110:8000',
'180.179.43.250:80',
'185.117.74.81:1080',
'116.199.2.196:80',
'118.193.107.119:80',
'128.199.77.93:8000',
'170.246.114.213:8080',
'104.243.47.146:1080',
'111.3.108.44:8118',
'124.42.7.103:80',
'39.134.161.18:80',
'146.185.156.221:8118',
'47.89.249.110:80',
'118.193.107.192:80',
'124.232.163.10:3128',
'223.19.105.206:80',
'46.166.168.243:1080',
'118.114.77.47:8080',
'182.253.205.85:8090',
'45.55.132.29:9999',
'58.251.227.238:8118',
'118.193.107.142:80',
'118.193.107.135:80',
'118.193.107.219:80',
'46.101.45.212:8118',
'114.249.45.176:8118',
'80.152.201.116:8080',
'94.177.254.86:80',
'197.155.158.22:80',
'196.200.173.83:80',
'212.237.10.45:8080',
'188.166.144.173:8118',
'210.71.198.230:8118',
'177.114.228.112:8080',
'218.50.2.102:8080',
'198.204.251.158:1080',
'188.166.204.221:8118',
'185.117.74.126:1080',
'106.39.179.244:80',
'39.134.161.14:8080',
'85.10.247.136:1080',
'46.166.168.245:1080',
'5.167.50.35:3129',
'118.178.227.171:80',
'122.96.59.102:82',
'52.174.89.111:80',
'103.25.173.237:808',
'121.232.145.168:9000',
'103.251.167.8:1080',
'46.101.26.217:8118',
'171.37.178.175:9797',
'103.251.166.18:1080',
'186.225.176.93:8080',
'121.232.147.132:9000',
'104.224.168.178:8888',
'47.90.2.253:8118',
'121.232.145.82:9000',
'118.193.107.36:80',
'58.56.128.84:9001',
'139.59.153.59:80',
'122.183.139.101:8080',
'163.172.184.226:8118',
'198.204.251.146:1080',
'213.133.100.195:1080',
'42.104.84.106:8080',
'117.2.64.109:8888',
'121.232.144.229:9000',
'156.67.219.61:8080',
'138.36.106.90:80',
'1.179.233.66:80',
'222.33.192.238:8118',
'138.197.224.12:8118',
'151.106.10.6:1080',
'134.35.250.204:8080',
'58.251.227.233:8118',
'52.221.40.19:80',
'222.73.68.144:8090',
'46.166.168.247:1080',
'192.99.222.207:80',
'1.23.160.212:8080',
]
#394996257 aljnn6er
#116.62.112.142 16816
from urllib import request
import re
# 检测代理服务器
def checkProxy(html):
data = re.compile("<title>百度一下,你就知道</title>")
title = data.findall(html)
if title:
return True
return False
def user_http_proxy(proxy_addr, url):
# 构造代理服务器handler
proxyH = request.ProxyHandler({"http":proxy_addr})
# 由这个proxy handler创建一个http的opener
opener = request.build_opener(proxyH, request.HTTPHandler)
# 把这个opener装进urllib
request.install_opener(opener)
# 请求
res = request.urlopen(url, timeout=6)
# 读取信息
data = res.read().decode()
return data
if __name__ == "__main__":
# proxy_addr = "394996257:[email protected]:16816"
# 测试免费代理服务器
# for i in l:
# proxy_addr = i
# try:
# data = user_http_proxy(proxy_addr, "http://www.sina.com")
# print(i)
# except:
# continue
#121.41.175.199:80
#124.42.7.103:80
#197.155.158.22:80
#218.50.2.102:8080
#58.56.128.84:9001
proxy_addr = "124.42.7.103:80"
data = user_http_proxy(proxy_addr, "http://www.baidu.com")
print(checkProxy(data))
with open('1.html','wb') as f:
f.write(data.encode())
# print(data)
版权声明
本文为[峰爷520]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_41752427/article/details/81084303
边栏推荐
- Troubleshooting of data deleted and reappeared problems
- Addition, deletion, query and modification of data
- Cf1427c the hard work of paparazzi
- [leetcode 6] zigzag transformation
- Robocode教程4——Robocode的游戏物理
- [leetcode 350] intersection of two arrays II
- Database - sorting data
- 如何安装jsonpath包
- 2. Average length of words
- Example of ticket selling with reentrant lock
猜你喜欢
随机推荐
Rust 中的 Cell 共享可变指针
Robocode教程5——Enemy类
Introduction to virtualization features
Integers have friends interval GCD + double pointer
4. Print form
[leetcode 6] zigzag transformation
GDAL+OGR学习
Addition, deletion, query and modification of data
Guaba and Computational Geometry
爬取手游网站游戏详情和评论(MQ+多线程)
Rust的闭包类型(Fn, FnMut, FnOne的区别)
Solution to the trial of ycu Blue Bridge Cup programming competition in 2021
电机与拖动(戚金清版)学习整理
7.Domino piling
Completely clean up MySQL win
P1018 maximum product solution
Failure to deliver XID in Seata distributed transaction project
[leetcode 19] delete the penultimate node of the linked list
[leetcode 202] happy number
How SYSTEMd uses / etc / init D script