Skip to content

Refactoring: Parameterizing localization in base.py #1

@Hurthv

Description

@Hurthv

Description

Currently, localization (locale, timezone, Accept-Language) is hard-coded to Russia in the init_context() method of the Parse class:

locale="ru-RU",
timezone_id="Europe/Moscow",
"Accept-Language": "ru-RU,ru;q=0.9",

This prevents the framework from being used for parsing international websites.

Solution:

Add localization parameters to __init__() and init_context():

  • locale (default "ru-RU")
  • timezone_id (default "Europe/Moscow")
  • language (default "ru-RU,ru;q=0.9")

Example:

parser = ParseOZON(keyword, browser, add_setup_blocker, locale="en-US", timezone_id="America/New_York")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions