Created
May 9, 2016 05:45
-
-
Save FGFW/ff09921503e4c1c9d0bb2bd1c8f8223a to your computer and use it in GitHub Desktop.
python3使用requests发闪存.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| python3使用requests发闪存.py | |
| 2016年5月9日 12:50:40 codegay | |
| 参考资料requests文档: | |
| http://cn.python-requests.org/zh_CN/latest/ | |
| """ | |
| import requests | |
| url='http://ing.cnblogs.com/ajax/ing/Publish' | |
| head={'Accept':'application/json, text/javascript, */*; q=0.01', | |
| 'Origin':'http://ing.cnblogs.com', | |
| 'X-Requested-With':'XMLHttpRequest', | |
| 'Content-Type':'application/json; charset=UTF-8', | |
| 'DNT':1, | |
| 'Referer':'http://ing.cnblogs.com/', | |
| 'Accept-Encoding':'gzip, deflate', | |
| 'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6', | |
| } | |
| #session 通过抓包工具,或者cookies工具可以得到. | |
| cookies={'.CNBlogsCookie':'67834BD16E61A87726AF2203F849339E8DEFF67BC4A453FDG830AC373CAC83BAAF2312B975279092095A0E143400E82BBEE189BD5CB8826CA6A6E836F69EC5783C410C2B815A833D5816CEB5B457B159A38F'}#←_←填你自己的session | |
| data={"content":"[天上的星星不说话]python大法好{}","publicFlag":1} | |
| s=requests.Session() | |
| for r in range(1,122): | |
| data['content']="[天上的星星不说话]python大法好{}".format(r) | |
| post=s.post(url,data,cookies=cookies) | |
| print(post.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment