fuck-login icon indicating copy to clipboard operation
fuck-login copied to clipboard

拉勾网的登录,出现“请勿重复提交,刷新页面后重试”

Open laichilueng opened this issue 6 years ago • 4 comments

X_Anti_Forge_Token以及X_Anti_Forge_Code这两个防爬虫code能获取到,但是结果是“请勿重复提交,刷新页面后重试”。本人刚学爬虫不久,分析不出具体原因,希望能给予一些帮助,衷心感谢。

laichilueng avatar Jul 21 '17 08:07 laichilueng

这个问题,好像是Request的异步导致的,换成requests去get就没问题了。可参考https://github.com/laichilueng/lagou_login/blob/master/lagou_login.py 爬虫前先登录然后调用get_cookies()便能获取到登陆后的cookie

laichilueng avatar Sep 14 '17 16:09 laichilueng

其实有个最最简单的方法 filebug里面的请求头里面复制cookie到setting文件里

DEFAULT_REQUEST_HEADERS = {
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'Accept-Language': 'en',
  'Host': 'www.lagou.com',
  'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36',
  'Referer': 'https://www.lagou.com/',
  'Cookie': "" #填写请求头里面复制cookie值
}

但是这个cookie有一个时间限制,能解决当前问题

GhostClock avatar Sep 15 '17 17:09 GhostClock

你把header头写成一模一样就没问题了

Axierty avatar Dec 27 '17 01:12 Axierty

解决了吗?

tywei90 avatar Dec 09 '18 16:12 tywei90