Skip to main content

Auto Generated by os-scrapy-cookiecutter

Project description

os-scrapy-random-useragent

Build Status codecov PyPI - Python Version PyPI

This project provide a Downloader Middleware to change 'User-Agent' of request headers.

Install

pip install os-scrapy-random-useragent

Usage

Settings

  • enable downloader middleware in settings.py file:

    this middleware will override default Scrapy User-Agent

    DOWNLOADER_MIDDLEWARES = {
        "os_scrapy_random_useragent.RandomUserAgentMiddleware": 543,
    }
    
  • config useragents:

    • by file:

      USER_AGENTS = "./your-useragets-file"
      
    • by string:

      USER_AGENTS = "Your-Useragent-String"
      
    • by list:

      USER_AGENTS = ["User-Agent-01", "User-Agent-02"]
      

Unit Tests

tox

License

MIT licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

os_scrapy_random_useragent-0.0.1.tar.gz (8.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page