人人网通过页面cookie获取登录后页面的数据

Posted zqrios

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了人人网通过页面cookie获取登录后页面的数据相关的知识,希望对你有一定的参考价值。

# coding=utf-8
import requests
import encodings


url = http://www.renren.com/965760322/profile

headers = {"User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (Khtml, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
"Cookie":"_ga=GA1.2.1673668380.1525490064; _gid=GA1.2.309052328.1525490064; anonymid=jgstek725vk13t; depovince=GW; _r01_=1; JSESSIONID=abcJ4lDqyz4p18NO0sUmw; ick=7e5bd320-6876-4cbb-b4d2-a6246e4031e1; jebe_key=e759c44c-5cda-4263-a620-65708fbe8910%7C05b2109f1ae864eeb00a5dda90e4e8dd%7C1525490214841%7C1%7C1525490211023; jebecookies=ab4362b6-29ed-49ec-8a59-85d086c46b98|||||; ick_login=ac0ba190-7c2b-4f2e-af0e-0160d855673d; _de=766E8DC5C696D44BC47AC836C6B99DBC; p=3788ee2119215248d2d41dc3a4ad60c22; first_login_flag=1; ln_uact=13018668622; ln_hurl=http://head.xiaonei.com/photos/0/0/men_main.gif; t=0cec2862af339d3701d0ae4366efaf9b2; societyguester=0cec2862af339d3701d0ae4366efaf9b2; id=965760322; xnsid=d1b2202b; ver=7.0; loginfrom=null; wp_fold=0"
           }

response = requests.get(url,headers=headers)
response.encoding = utf-8
print(response.text)

# with open("renren1.html", "w", encoding=‘utf-8‘) as f:
    # response.encoding = ‘utf-8‘
    # f.write(response.text)
    # f.write(response.content.decode())

 

以上是关于人人网通过页面cookie获取登录后页面的数据的主要内容,如果未能解决你的问题,请参考以下文章

Python爬虫--人人网模拟登录cookie

登录到ADSL猫的设置页面。怎么通过查看网页源代码得到上网帐号和密码啊

4 手动方式从浏览器中复制cookie请求网页

4 手动方式从浏览器中复制cookie请求网页

官网的岗位内网没有

selenium:python如何绕过登录页面登录网页