-
Notifications
You must be signed in to change notification settings - Fork 184
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
运行成功,但没有结果 #3
Comments
看了下,猫眼的首页加了个验证码验证,所以没有获取到正确的网页源代码 |
进入猫眼首页,手动验证一下,代码就可以运行了 |
可以先手动登录猫眼网站,然后在浏览器获取自己的cookie,然后在get_one_page(url)函数中添加一个 cookie,然后在请求里添加cookie |
Debug 后, 发现猫眼首页添加了反爬虫-验证拼图,所以后面的返回的是一个验证url,自然爬取不了,等学习到后面如何处理验证,再回来解答 |
今天试了一下,爬是可以爬,但好像爬了一次以后要隔一段时间才能再爬 |
程序虽然运行成功,但是没有结果。
debug后,发现在正则匹配的时候没有返回结果。
items = re.findall(pattern, html)
items 为空The text was updated successfully, but these errors were encountered: