8000 Parser kwargs no accepted · Issue #128 · hellock/icrawler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Parser kwargs no accepted #128
Closed
Closed
@ed2050

Description

@ed2050

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0