Skip to content

Commit a634efe

Browse files
author
cuizhongyi
committed
'修改代理ip'
1 parent 10caa5e commit a634efe

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

抓取IP地址/get_ip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def check_ip(self, ip_info):
3333
proxies = {'http': 'http://' + ip_url, 'https': 'https://' + ip_url}
3434
res = False
3535
try:
36-
request = requests.get(url=self.check_url, headers=self.header, proxies=proxies, timeout=5)
36+
request = requests.get(url=self.check_url, headers=self.header, proxies=proxies, timeout=3)
3737
if request.status_code == 200:
3838
res = True
3939
except Exception as error_info:
@@ -60,7 +60,7 @@ def run(self):
6060
ip_type = td_list[5].get_text()
6161
info = {'ip': ip_address, 'port': ip_port, 'type': ip_type}
6262
# 先校验一下IP的有效性再存储
63-
check_res = self.check_ip(info);
63+
check_res = self.check_ip(info)
6464
if check_res:
6565
print('IP有效:', info)
6666
self.json_data.append(info)

抓取IP地址/ip.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"ip": "223.241.5.139", "port": "4216", "type": "HTTPS"}, {"ip": "58.220.95.35", "port": "10174", "type": "HTTP"}, {"ip": "58.220.95.30", "port": "10174", "type": "HTTP"}, {"ip": "36.250.156.73", "port": "9999", "type": "HTTPS"}, {"ip": "1.198.72.253", "port": "9999", "type": "HTTP"}]

抓取IP地址/ip1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"ip": "223.241.5.139", "port": "4216", "type": "HTTPS"}, {"ip": "58.220.95.35", "port": "10174", "type": "HTTP"}, {"ip": "58.220.95.30", "port": "10174", "type": "HTTP"}, {"ip": "36.250.156.73", "port": "9999", "type": "HTTPS"}, {"ip": "1.198.72.253", "port": "9999", "type": "HTTP"}]

0 commit comments

Comments
 (0)