alecxe / scrapy-fake-useragent

Random User-Agent middleware based on fake-useragent
MIT License
687 stars 98 forks source link

Enabling FALLBACK setting on `settings.py` #14

Closed vionemc closed 7 years ago

vionemc commented 7 years ago

https://pypi.python.org/pypi/fake-useragent

There said

You can completely disable ANY annoying exception with adding fallback: (version 0.1.4 added)

import fake_useragent

ua = fake_useragent.UserAgent(fallback='Your favorite Browser')
# in case if something went wrong, one more time it is REALLY!!! rare case
ua.random == 'Your favorite Browser'

I want to use that fallback feature easily in Scrapy FakeUserAgent just by setting FAKEUSERAGENT_FALLBACK in settings.py

alecxe commented 7 years ago

@vionemc good idea! Thanks!