騰訊sso.qq.com接口獲取騰訊旗下域名資產
# -*- coding:utf-8 -*-
import requests
import time
import re
header ={
'Connection': 'close',
'Accept': 'application/json, text/plain, */*',
'Accept - Encoding':'gzip, deflate',
'Accept-Language':'zh-CN,zh;q=0.9',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'
}
f = open('url.txt','w',encoding = 'UTF-8')
for i in range(10000,50000):
try:
url = "https://sso.qq.com/open/appinfo?app={}".format(i)
get = requests.get(url = url,headers = header,timeout=1)
except:
pass
#time.sleep(2)
reSponse = get.text
info = re.findall('"PortalUrl":"(.*?)"',reSponse)
print("寫入的url為:",info)
f.writelines(info)
f.writelines('\n')
#print(f)
f.close()