【发布时间】:2016-04-12 13:20:32
【问题描述】:
我正在为 www.researchgate.net 编写爬虫程序,但似乎我会永远卡在登录页面中。
这是我的代码:
import requests
from bs4 import BeautifulSoup
session = requests.Session()
params = {'login': 'my_email', 'password': 'my_password'}
session.post("https://www.researchgate.net/application.Login.html", data = params)
s = session.get("https://www.researchgate.net/search.Search.html?type=researcher&query=zhang")
print BeautifulSoup(s.text).title
有人能发现我的代码有什么问题吗?为什么s每次都重定向到登录页面?
【问题讨论】:
-
您没有为认证提供所有信用。在您的浏览器中检查您发送到网络以进行连接的内容
标签: python web-crawler python-requests