码迷,mamicode.com
首页 > 其他好文 > 详细

百度文库下载(用别人的爬虫)

时间:2018-06-25 20:26:41      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:gen   百度文库   ref   none   accept   name   tps   提交数据   style   

参考博客:https://blog.csdn.net/qq_17054989/article/details/80168214

参考网址:http://39.108.149.27:9999

技术分享图片
import requests

header = {Accept: text/plain, */*; q=0.01,  # 模拟浏览器头信息
          Accept-Encoding: gzip, deflate,
          Accept-Language: zh-CN,zh;q=0.9,
          Connection: keep-alive,
          Content-Length: 135,
          Content-Type: application/x-www-form-urlencoded,
          Host: 39.108.149.27:9999,
          Origin: http://39.108.149.27:9999,
          Referer: http://39.108.149.27:9999/,
          User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36,
          X-Requested-With: XMLHttpRequest
          }
wenku = input(请输入您要下载文档的地址:)
# 真实网址
url = http://39.108.149.27:9999/default.aspx
# 提交数据
datas = {
    username: ‘‘,
    password: ‘‘,
    txtUrl: {}.format(wenku),
    mail: XXXXXXXX@qq.com#在这里输入你自己的邮箱哦亲
}
html = requests.request("POST", url, data=datas, headers=header)
print(html.text)
View Code

 

百度文库下载(用别人的爬虫)

标签:gen   百度文库   ref   none   accept   name   tps   提交数据   style   

原文地址:https://www.cnblogs.com/pandaboy1123/p/9225851.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!