Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Overflow好像无法实现登录了 #57

Closed
BLACKMogus opened this issue Apr 17, 2021 · 1 comment
Closed

Stack Overflow好像无法实现登录了 #57

BLACKMogus opened this issue Apr 17, 2021 · 1 comment

Comments

@BLACKMogus
Copy link

Stack Overflow不登录情况下搜索帖子有上限,然后我通过下面代码去登录,但是搜索条目依然有限制,请问该怎么办
lg = login.Login()
infos_return, session = lg.stackoverflow('xxxxxxxxxxxxx','xxxxxxxxxxxx','pc')#打码
response = session.post(url,data=formdata,headers=headers)
page = response.content
root = html.fromstring(page)
totalnum = root.xpath('//*[@id="mainbar"]/div[4]/div[1]/text()')
print(totalnum)

@CharlesPikachu
Copy link
Owner

我这边测试登录返回的信息没有错误,你可以把完整的代码贴上来看看。或者可以尝试一下把cookies拿出来新开一个session进行请求。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants