After call parse_list , I can only get URL like this http://weixin.sogou.com/websearch/art.jsp?sg=CBf80b2xkgZWehj5vWa6p7H14b.... . However, most weixin essay's direct link is something like this http://mp.weixin.qq.com/s?__biz=MjM5NjM4OTAyMA=.... . If you request the first link you can get 302 redirection. Response header:
The question is that I cannot get the redirect url using requests package:
r = requests.get(link, headers=headers, cookies=cookies)
print(r.headers)
print(r.url)
for resp in r.history:
print(resp.status_code, resp.url)
I try to use this code to get response Location in the header. But I always get 200 status code not 302. And get 当前请求已过期,请点击重新加载 error. Did I miss something?
After call parse_list , I can only get URL like this
http://weixin.sogou.com/websearch/art.jsp?sg=CBf80b2xkgZWehj5vWa6p7H14b....
. However, most weixin essay's direct link is something like thishttp://mp.weixin.qq.com/s?__biz=MjM5NjM4OTAyMA=....
. If you request the first link you can get 302 redirection. Response header:The question is that I cannot get the redirect url using
requests
package:I try to use this code to get response Location in the header. But I always get 200 status code not 302. And get
当前请求已过期,请点击重新加载
error. Did I miss something?