如何利用python爬虫提交json数据
PHPz
PHPz 2017-04-17 17:32:51
0
3
504

如题,目标是不需要POST的站点,已经按照抓包的结果伪装成了浏览器,似乎还少了点什么,抓包数据里面有发现JSON数据,感觉是因为这个原因,但是我不明白要如何正确提交,所以收到的是乱码字符或者是不完整的页面源码。我用浏览器获取了网页源代码做了比较确实不完整,爬虫只拿到了头部和尾部。不用管AJAX,因为就连摘取到的第一页的内容都是不完整的。

PHPz
PHPz

学习是最好的投资!

reply all(3)
黄舟

Go to the json request and just grab the data of that request

伊谢尔伦

You provided too little information. . .

  1. What on earth do you want to do? Are you submitting a GET request? (You are talking about a site without POST)

  2. Which library are you using? urllib.request?

  3. Under what circumstances do you receive garbled characters? What kind of garbled code? When do you receive incomplete source code? How do you know the source code is incomplete?

巴扎黑

Is the content you want to crawl loaded through AJAX? From your description, it seems that what you want is not in html, but you found it in json.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template