diff --git "a/\346\212\223\345\217\226IP\345\234\260\345\235\200/get_ip.py" "b/\346\212\223\345\217\226IP\345\234\260\345\235\200/get_ip.py" index 8114fba..32af8da 100644 --- "a/\346\212\223\345\217\226IP\345\234\260\345\235\200/get_ip.py" +++ "b/\346\212\223\345\217\226IP\345\234\260\345\235\200/get_ip.py" @@ -33,7 +33,7 @@ def check_ip(self, ip_info): proxies = {'http': 'http://' + ip_url, 'https': 'https://' + ip_url} res = False try: - request = requests.get(url=self.check_url, headers=self.header, proxies=proxies, timeout=5) + request = requests.get(url=self.check_url, headers=self.header, proxies=proxies, timeout=3) if request.status_code == 200: res = True except Exception as error_info: @@ -60,7 +60,7 @@ def run(self): ip_type = td_list[5].get_text() info = {'ip': ip_address, 'port': ip_port, 'type': ip_type} # 先校验一下IP的有效性再存储 - check_res = self.check_ip(info); + check_res = self.check_ip(info) if check_res: print('IP有效:', info) self.json_data.append(info) diff --git "a/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip.json" "b/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip.json" index e69de29..86507ea 100644 --- "a/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip.json" +++ "b/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip.json" @@ -0,0 +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"}] diff --git "a/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip1.json" "b/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip1.json" new file mode 100644 index 0000000..4cc7ff2 --- /dev/null +++ "b/\346\212\223\345\217\226IP\345\234\260\345\235\200/ip1.json" @@ -0,0 +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"}] \ No newline at end of file