We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最近使用猪哥的工具 发现返回结果没有域名的标题啥的 自己写了个小脚本 希望猪哥参考添加进去 `import requests import json from bs4 import BeautifulSoup
domain = set() jsonname = ['alexa.json', 'chaxunla.json', 'dnsburte.json', 'ilinks.json', 'netcraft.json', 'sitedossier.json' , 'threatminer.json'] def do_json(name): with open(name) as f: data = json.load(f) return data
def get_title(url): try: headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 UBrowser/6.0.1471.914 Safari/537.36'} url = 'http://'+url print(url) response = requests.get(url=url, headers=headers,timeout=5,verify=False) response.encoding = response.apparent_encoding response = BeautifulSoup(response.text,'lxml') title = response.html.title.get_text() except: title = '空' return title
for i in jsonname: for url in do_json(name=i): domain.add(url)
with open('result.txt','w',errors='ignore') as f: for i in domain: title = get_title(url=i) print(title) f.write(i+' '+title+'\n')
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
最近使用猪哥的工具 发现返回结果没有域名的标题啥的
自己写了个小脚本 希望猪哥参考添加进去
`import requests
import json
from bs4 import BeautifulSoup
domain = set()
jsonname = ['alexa.json', 'chaxunla.json', 'dnsburte.json', 'ilinks.json', 'netcraft.json', 'sitedossier.json'
, 'threatminer.json']
def do_json(name):
with open(name) as f:
data = json.load(f)
return data
def get_title(url):
try:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 UBrowser/6.0.1471.914 Safari/537.36'}
url = 'http://'+url
print(url)
response = requests.get(url=url, headers=headers,timeout=5,verify=False)
response.encoding = response.apparent_encoding
response = BeautifulSoup(response.text,'lxml')
title = response.html.title.get_text()
except:
title = '空'
return title
for i in jsonname:
for url in do_json(name=i):
domain.add(url)
with open('result.txt','w',errors='ignore') as f:
for i in domain:
title = get_title(url=i)
print(title)
f.write(i+' '+title+'\n')
`
The text was updated successfully, but these errors were encountered: