A random user-agent for all your needs
Project description
scrapy-random-useragent-pro
Random UserAgent middleware for Scrapy.
You can chose your preferred ua in request.meta[desktop,mobile,bot].
Install
pip install scrapy-random-useragent-pro
Usage
settings.py
RANDOM_UA_ENABLED = True
RANDOM_UA_DEFAULT_TYPE = 'mobile'
# always change user-agent
RANDOM_UA_OVERWRITE = False
DOWNLOADER_MIDDLEWARES = {
'scrapy_random_useragent_pro.middleware.RandomUserAgentMiddleware': 100,
'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware': None,# important
}
In your code
yield Request('http://scrapytest.org/', meta={'ua': 'mobile'})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for scrapy-random-useragent-pro-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4b1ef90ae35ec75d075a635db76588ead271f5a0f60159ffe88ce77266dc69d |
|
MD5 | c383a17f2e8b8b17bd1fc40793735d87 |
|
BLAKE2b-256 | 58a6054757f52b10c2bb861297ece1bceb70b098f066e77b0aa8c7b1c6da66b9 |
Close
Hashes for scrapy_random_useragent_pro-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c379972043ba140c016f9c759457cbac5fc397bcaec709590122e6f0f58896a0 |
|
MD5 | 1baf300de7eff78d5440a72a6144f658 |
|
BLAKE2b-256 | 19e6863bce05bf8d5b380c7b6c9b24a08c9b7a7d509797d3da0ec5c8b994a0b5 |