generic.mixins.file_downloader#

Module Contents#

Classes#

FileDownloaderMixinConfig

Config class for FileDownloaderMixin.

FileDownloaderMixin

Provides file download capability.

API#

class generic.mixins.file_downloader.FileDownloaderMixinConfig(/, **data: Any)#

Bases: generic.spiders.base.GenericSpiderConfig

Config class for FileDownloaderMixin.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

file_regexp: str = '\\.pdf$'#
output_dir: str = './'#
class generic.mixins.file_downloader.FileDownloaderMixin#

Provides file download capability.

parse_file_download_page(res: scrapy.http.Response)#
extract_file_download_hrefs(response: scrapy.http.Response) list#
parse_file_download_file(res: scrapy.http.Response, context_response: scrapy.http.Response)#