import json
import random
import requests
headers = {
''Host'': ''x.x.x.x'',
''User-Agent'': ''Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.28 Safari/537.36 OPR/61.0.3298.6 (Edition developer)'',
''Accept'': ''application/json, text/plain, */*'',
''Accept-Language'': ''zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2'',
''Accept-Encoding'': ''gzip, deflate'',
''Content-Type'': ''application/json;charset=utf-8'',
''Content-Length'': ''80'',
''Origin'': ''http://x.x.x.x'',
''Connection'': ''close'',
''Referer'': ''http://x.x.x.x/setting/rule''
}
url1 = ''http://x.x.x.x/api/setting/query''
url_list = []

def getdata(company, urls):
data = {
"tag": company,
"keyword": urls,
"enabled": ''false''

}
return json.dumps(data)

with open("url.txt", encoding=''utf-8'') as f:
for url in f.readlines():
if url != None:
url_list.append(url.strip("\\n"))

print(url_list[0])

print(url_list)

for urlss in url_list:
for i in range(0, len(url_list)):
companys = ''中国外汇交易中心(全国银行间同业拆借中心)'' + str(random.randint(1,4000))
print(urlss)
print(companys)
res = requests.post(url1, headers=headers, data=getdata(company=companys, urls=urlss))
break
最后修改:2021 年 02 月 10 日 08 : 45 PM
如果觉得我的文章对你有用,请随意赞赏