在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/Python/ 用requests實(shí)現(xiàn)網(wǎng)頁(yè)登錄抓取后得到<Response [200]&g

用requests實(shí)現(xiàn)網(wǎng)頁(yè)登錄抓取后得到<Response [200]>

我本來(lái)想要用requests來(lái)抓取我們cluepoints網(wǎng)頁(yè)里面的json數(shù)據(jù),樣式如下:
圖片描述

這個(gè)網(wǎng)站是需要登錄的,我的代碼如下:

 import requests
 s= requests.session()
 data = {"user":"xwei","passdw":"Lovelinbo19910716"}
 res=s.post("https://login.cluepoints.com/",data)
 s.get("https://login.cluepoints.com/locations/overall_details?analysis_id=5af55f90e41f0651a599438e")

得到的結(jié)果卻是:

<Response [200]>

而且我想以json格式返回也是會(huì)報(bào)錯(cuò):

 Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    s.json()
AttributeError: 'Session' object has no attribute 'json'

請(qǐng)前輩們指點(diǎn)一下。其實(shí)我就是想要抓取上面圖片里面的數(shù)據(jù)到j(luò)son格式。

回答
編輯回答
氕氘氚

res=s.post("https://login.cluepoints.com/",data) 這一步就有問(wèn)題了 ,可以
print res.content 看下返回值

2018年8月18日 19:22
編輯回答
焚音

res=s.post("https://login.cluepoints.com/",data={"user":"xwei","passdw":"Lovelinbo19910716"})

2017年12月24日 07:03
編輯回答
喜歡你

首先 data這里 你沒(méi)賦值

2018年7月5日 09:43
編輯回答
老梗
response = s.get('......')
result = response.json()
2017年5月21日 02:38