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

Parser kwargs no accepted #128

Closed
ed2050 opened this issue Jun 5, 2024 · 1 comment
Closed

Parser kwargs no accepted #128

ed2050 opened this issue Jun 5, 2024 · 1 comment

Comments

@ed2050
Copy link

ed2050 commented Jun 5, 2024

The Crawler class takes a classname for the parser class, and a dict of parser_args to instantiate the parser:

class Crawler:
    def __init__(
        ...
        parser_cls=Parser,
        extra_parser_args=None,
        ...
    ):
        ...
        parser_kwargs = {} if extra_parser_args is None else extra_parser_args
        self.parser = parser_cls(parser_threads, self.signal, self.session, **parser_kwargs)

Yet the parser class doens't accept any kwargs. It's constructor is:

class Parser(ThreadPool):
    def __init__(self, thread_num, signal, session):

Why is this the case? It causes problems when passing extra kwargs. For example

ZhiyuanChen added a commit to ZhiyuanChen/icrawler that referenced this issue Jul 29, 2024
Signed-off-by: Zhiyuan Chen <this@zyc.ai>
@ZhiyuanChen
Copy link
Collaborator

Please let me know if 4273064 can fix your issue

ZhiyuanChen added a commit that referenced this issue Jul 29, 2024
Signed-off-by: Zhiyuan Chen <this@zyc.ai>
ZhiyuanChen added a commit that referenced this issue Jul 29, 2024
Signed-off-by: Zhiyuan Chen <this@zyc.ai>
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