We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
请问如何限制爬取电影的数量呢?
The text was updated successfully, but these errors were encountered:
@young2333 限制爬取电影数量,这个需要对代码进行改造下。大体思路是:TopWorkThread 类中增加判断 TaskQueue 中的 contentQueue 的大小逻辑。因为程序用到多线程,需要要考虑到线程安全,建议加个 锁。
TopWorkThread
TaskQueue
contentQueue
另外补充下这几个类的作用:
middleQueue middleQueue 是一个队列,里面存放着带有电影详情页的电影分页的 url 地址。每个 url 地址(电影分页)有 25 部电影。
middleQueue
TopWorkThread TopWorkThread 的作用是依次从 middleQueue 中的获取一个 url 地址,然后访问该 url 地址。从返回结果中,解析出 电影详情页的 url 地址,然后存储到 ContentQueue 中。
Sorry, something went wrong.
好的,谢谢回复
No branches or pull requests
请问如何限制爬取电影的数量呢?
The text was updated successfully, but these errors were encountered: