Python爬取站长之家端口扫描接口

也想出现在这里?
联系我们吧
import requests,time import random from bs4 import BeautifulSoup import re import threading def ports(hostm,port): url = 'http://tool.chinaz.com/port/' headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36' } data = { 'host':hostm, 'port':port } response = requests.post(url,headers=headers,data=data).text encode = BeautifulSoup(response,'html.parser').findAll('input',{"id":"encode"})[0].get('value') data['encode'] = encode callback = "jQuery113"+str(int(random.random()*100000000000000000))+'_'+str(int(time.time()*1000)) params = { 'callback':callback, 't':'port' } url = 'http://tool.chinaz.com/iframe.ashx' response = requests.post(url,headers=headers,data=data,params=params).text response = re.sub(callback,'',response) print(re.findall(r"'(.*?)'",response)[0]) return re.findall(r"'(.*?)'",response)[0] if __name__=="__main__": for i in range(0,1000): # print(ports('baidu.com', str(i))) threading.Thread(target=ports,args=('baidu.com', str(i))).start()
本站声明:
本站所有资源来源于网络,分享目的仅供大家学习和交流!如若本站内容侵犯了原著者的合法权益,可联系邮箱976157886@qq.com进行删除。
自学哈专注于免费提供最新的分享知识、网络教程、网络技术的资源分享平台,好资源不私藏,大家一起分享!
自学哈网 » Python爬取站长之家端口扫描接口
本站所有资源来源于网络,分享目的仅供大家学习和交流!如若本站内容侵犯了原著者的合法权益,可联系邮箱976157886@qq.com进行删除。
自学哈专注于免费提供最新的分享知识、网络教程、网络技术的资源分享平台,好资源不私藏,大家一起分享!
自学哈网 » Python爬取站长之家端口扫描接口

也想出现在这里?
联系我们吧