我的表格結構登錄:無法使用python請求模塊
<POST https://www.lumosity.com/authentication application/x-www-form-urlencoded
<HiddenControl(utf8=✓) (readonly)>
<HiddenControl(authenticity_token=xMELAlMu5kqxE23RdvRj+UjyF+bXVynw9AgHIc2j69Q=) (readonly)>
<HiddenControl(screen_resolution=) (readonly)>
<HiddenControl(activation_code=) (readonly)>
<HiddenControl(redirect_uri=) (readonly)>
<TextControl(user[login]=)>
<PasswordControl(user[password]=)>
<SubmitControl(commit=Log In) (readonly)>
<SubmitButtonControl(<None>=) (readonly)>
<CheckboxControl(persistent_login=[*1])>>
我的登錄IS代碼:
import requests
from bs4 import BeautifulSoup as bs
payload = {
'user[login]' : '***@gmail.com',
'user[password]' : '******'
}
with requests.Session() as s:
m = s.get('https://www.lumosity.com/login',headers={'User-agent': 'Mozilla/5.0'})
t = s.post('https://www.lumosity.com/login',data = payload)
r = s.get('http://www.lumosity.com/app/v4/dashboard')
目前我沒有使用「真實性令牌」在日誌記錄。 是否需要?
- 如果是這樣,我該如何訪問它?
- 做全部表單結構中的參數需要通過「有效載荷」,即 ,即使有些是空的?
- 一旦我登錄成功,我應該打印哪些內容來驗證它是否成功?
感謝u.it工作 – dreamer 2014-10-06 15:35:50