- from urllib import request
- import sys
- from urllib import parse
- import re
- base_url = "https://www.beianx.cn/search/"
- real_url = base_url + parse.quote(sys.argv[1])
- print(real_url)
- s = request.urlopen(request.Request(real_url)).read().decode('utf-8')
- alist = re.findall('<td\s+>\s+\s+<a\starget="_blank" href=[^>]+>(.+)<\/a>',s)
- blist = re.findall('<td\s+\s+nowrap="nowrap">\s+(.+)\r\s+<\/td>',s)
- print("主域名数量:",len(alist))
- for a in alist:
- print(a)
- for b in blist:
- print(b)
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |