运行效果:
代码如下:
# coding:utf-8 import requests headers = { 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding':'gzip, deflate, br', 'Accept-Language':'zh-CN,zh;q=0.9,en;q=0.8', 'Cache-Control':'max-age=0', 'Connection':'keep-alive', 'Cookie':'', 'Host':'data.zz.baidu.com', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'curl/7.12.1', } # 百度提交api url = 'http://data.zz.baidu.com/urls?site=https://www.xxx.cn&token=0umWUJcYh0Hsyarf' #读取url urls = open('urls.txt').read() response = requests.post(url,data=urls,headers=headers) print(response.text)