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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrapy-random-useragent-pro-1.0.0.tar.gz.
File metadata
- Download URL: scrapy-random-useragent-pro-1.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b1ef90ae35ec75d075a635db76588ead271f5a0f60159ffe88ce77266dc69d
|
|
| MD5 |
c383a17f2e8b8b17bd1fc40793735d87
|
|
| BLAKE2b-256 |
58a6054757f52b10c2bb861297ece1bceb70b098f066e77b0aa8c7b1c6da66b9
|
File details
Details for the file scrapy_random_useragent_pro-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: scrapy_random_useragent_pro-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c379972043ba140c016f9c759457cbac5fc397bcaec709590122e6f0f58896a0
|
|
| MD5 |
1baf300de7eff78d5440a72a6144f658
|
|
| BLAKE2b-256 |
19e6863bce05bf8d5b380c7b6c9b24a08c9b7a7d509797d3da0ec5c8b994a0b5
|