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

分布式爬虫-Spider - feapder-document #16

Open
Boris-code opened this issue Mar 15, 2021 · 16 comments
Open

分布式爬虫-Spider - feapder-document #16

Boris-code opened this issue Mar 15, 2021 · 16 comments

Comments

@Boris-code
Copy link
Owner

https://boris.org.cn/feapder/#/usage/Spider

feapder是一款支持分布式、批次采集、任务防丢、报警丰富的python爬虫框架

@Leezj9671
Copy link

那么 feapder 是怎么解决充分利用多核性能的问题呢?

@Boris-code
Copy link
Owner Author

@Leezj9671
那么 feapder 是怎么解决充分利用多核性能的问题呢?

可以启动多个进程,同时采集

@JinxYuan
Copy link

如果redis里面存的不是url怎么办?
start_callback好像拿不到redis数据

@Boris-code
Copy link
Owner Author

如果redis里面存的不是url怎么办?
start_callback好像拿不到redis数据

你的任务是没url 不需要下载的么?不需要下载有个参数 auto_request=False就可以了
https://boris.org.cn/feapder/#/source_code/Request

@JinxYuan
Copy link

是的。
任务里是请求的参数和一些数据,数据需要拿出来和网页的请求数据做对比,
所以我这启动任务之后,是需要先拿到redis里的数据,才开始请求的。
没有找到怎么拿redis数据,我的生产环境是不能连数据库的

@Boris-code
Copy link
Owner Author

是的。
任务里是请求的参数和一些数据,数据需要拿出来和网页的请求数据做对比,
所以我这启动任务之后,是需要先拿到redis里的数据,才开始请求的。
没有找到怎么拿redis数据,我的生产环境是不能连数据库的

不能连redis数据库,还要在redis里拿数据?

@JinxYuan
Copy link

不好意思,我表达的不好。
redis里面存的是请求需要的数据,
爬虫启动的时候需要先去redis里面取数据拼url和数据对比,然后在开始请求
生产环境只能连redis,不能练sql server。
我主要想解决的就是,启动的时候能不能拿redis里面存的数据

@Boris-code
Copy link
Owner Author

不好意思,我表达的不好。
redis里面存的是请求需要的数据,
爬虫启动的时候需要先去redis里面取数据拼url和数据对比,然后在开始请求
生产环境只能连redis,不能练sql server。
我主要想解决的就是,启动的时候能不能拿redis里面存的数据

你可以使用框架封装好的RedisDB :http://feapder.com/#/source_code/RedisDB
也可以使用 第三方包: redis
如果你用的是Spider爬虫,任务是start_requests下发的,那框架会自动把任务取回来,然后可以在download_midware中拼接任务

@JinxYuan
Copy link

JinxYuan commented May 25, 2021

ok,大佬🐂🍺。
等大佬的管理平台出来了,开始慢慢迁移。

@Boris-code
Copy link
Owner Author

ok,大佬🐂🍺。
等大佬的管理平台出来了,开始慢慢迁移。

好哒

@1295801348
Copy link

自动入库报错

setting配置
MYSQL_IP = "localhost"
MYSQL_PORT = 3306
MYSQL_DB = "qgzz"
MYSQL_USER_NAME = "root"
MYSQL_USER_PASS = "root"

2021-12-17 18:51:04.270 | ERROR | feapder.db.mysqldb:init:77 -
连接数据失败:
ip: None
port: 3306
db: None
user_name: None
user_pass: None
exception: (1045, "Access denied for user 'Administrator'@'localhost' (using password: NO)")
大佬看一下

@1295801348
Copy link

error:'MysqlDB' object has no attribute 'connect_pool'
sql: insert ignore into enterprise (code, name, qy_name, region_name) values (%s, %s, %s, %s)

@Boris-code
Copy link
Owner Author

自动入库报错

setting配置

MYSQL_IP = "localhost"
MYSQL_PORT = 3306
MYSQL_DB = "qgzz"
MYSQL_USER_NAME = "root"
MYSQL_USER_PASS = "root"
2021-12-17 18:51:04.270 | ERROR | feapder.db.mysqldb:init:77 - 连接数据失败: ip: None port: 3306 db: None user_name: None user_pass: None exception: (1045, "Access denied for user 'Administrator'@'localhost' (using password: NO)") 大佬看一下

这不很明显你的setting没读到么,可以用main.py运行,或者把项目加到python的搜索路径

@houwudi14010
Copy link

为什么 创建爬虫任务的时候 上下键无法选择对应的模板

@Boris-code
Copy link
Owner Author

为什么 创建爬虫任务的时候 上下键无法选择对应的模板

window的pycharm下这个功能有点问题,你用cmd是可以的

@houwudi14010
Copy link

@Boris-code

为什么 创建爬虫任务的时候 上下键无法选择对应的模板

window的pycharm下这个功能有点问题,你用cmd是可以的

好的 谢谢大佬

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

No branches or pull requests

5 participants