Python Language Web scraping with Python Modify Scrapy user agent


Sometimes the default Scrapy user agent ("Scrapy/VERSION (+") is blocked by the host. To change the default user agent open, uncomment and edit the following line to what ever you want.

#USER_AGENT = 'projectName (+'

For example

USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'