我试图使用Python Request
库读取提取配置文件,它再次默认返回登录屏幕,而不是我的配置文件屏幕。这可能是由于缺少验证码。有什么建议?
import sys
import requests
headers = {
'User-Agent': "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",
'Accept-Encoding': 'gzip, deflate',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
}
loginInfo={
'session-key' : 'username@gmail.com',
'session-password' : 'password'
}
URL='https://www.linkedin.com/uas/login-submit'
s=requests.session()
s.post(URL,data=loginInfo,headers=headers)
response=s.get('http://www.linkedin.com/nhome')
# print response.txt