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

Open
ed2050 opened this issue Jun 5, 2024 · 0 comments
Open

Parser kwargs no accepted #128

ed2050 opened this issue Jun 5, 2024 · 0 comments

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

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

1 participant