Closed markx closed 9 years ago
Ok. Maybe tencent comic has changed its page structure. I'll fix this issue, wait please.
I've found the reason. Because the picJsonPage url like http://pad.ac.qq.com/View/mGetPicHash?id=512991&cid=27
must request with cookie
, otherwise it will return nothing.
So I will parse the cookie
, it may take some times.
Bug fixed. Please check 535702b710093f314a83cda80175fe590990848c
Cookie must contains ac_refer=
.
Please checkout the latest code and try again.
Windows bundle package is uploading.
Good job! May I ask you how you found the reason and what tools did you use?
Chrome F12 developer tools
and Firefox firebug add-on is my friends.
Also, the command tool curl is an awesome tool.
Curl can simulate and fake the browser request, it's helpful when debugging the request headers.
When I use curl -v http://pad.ac.qq.com/View/mGetPicHash?id=512991&cid=27
, returns nothing, but chrome works well. So I compare the headers between curl and chrome, and finally I've found curl -v -H 'Cookie:xxxxxxxxxxxx(copy from chrome)'
can get the json string. Then I know must request with Cookie
. But the cookie string is too long, so I use firefox and open firebug to check the cookie. After flush all cookies, I've found that when the cookie add the ac_refer
field, picjsonpage will return json string.
After all, use curl to verify.
curl -v -H 'Cookie: ac_refer=http://pad.ac.qq.com/Comic/comicInfo/id/512991' 'http://pad.ac.qq.com/View/mGetPicHash?id=512991&cid=27'
and it works.
Cool! Thanks.
It gets empty picJsonPage, thus json.loads(picJsonPage) raises exception.