织梦CMS - 轻松建站从此开始!

沙龙国际-沙龙国际娱乐-沙龙国际网上娱乐

当前位置: 主页 > 沙龙国际客户端 >

(沙龙国际客户端) 知乎上的个人详细页面post地址

时间:2017-07-17 18:39来源:未知 作者:admin 点击:

我处理的时候出现以下内容的:

每次点击修改内容,都会出现ProfileHeaderV2这个链接信息,但访问是404的,
然后又提示post信息却又是这个地址,这是为咋的?

======================

补充代码

# /usr/bin/python
#coding:utf-8
__author__ = 'eyu Fanne'

import requests,time
from bs4 import BeautifulSoup

begintime = time.time()



headers={
    "Host":"www.zhihu.com",
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36",
    "Accept":"*/*",
    "Accept-Language":"zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    "Accept-Encoding":"gzip, deflate",
    "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",
    "X-Requested-With":"XMLHttpRequest",
    "Connection":"keep-alive"
}


login_url=r'https://www.zhihu.com/login/email'

html_txt = requests.get(login_url,verify=False).text
html_soup = BeautifulSoup(html_txt,'lxml')
xsrf = html_soup.find("input",{"name":"_xsrf"})['value']

#print xsrf
#print html_txt
s = requests.session()

url_data={
    "_xsrf":xsrf,
    "email":"*****",
    "password":"*****",
    'remember_me':'true'
}

s_login=s.post(login_url,data=url_data,headers=headers,verify=False)
print s_login.text

# endtime = time.time()
# usetime =  endtime - begintime
# print "执行脚本总用时 %s 秒" % usetime


#print s.get('https://www.zhihu.com',verify=False).text

#修改个人简介

edit_url=r'https://www.zhihu.com/node/ProfileHeaderV2'
peplo_url=r'https://www.zhihu.com/people/shui-di-you/about'
edit_html_txt = s.get(peplo_url,verify=False).text
#print edit_html_txt.text

exit_html_soup = BeautifulSoup(edit_html_txt,'lxml')
edit_xsrf = exit_html_soup.find("input",{"name":"_xsrf"})['value']
print 'edit_xsrf:%s' 
      
      (责任编辑:admin)
织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
推荐内容