I subclassed a CrawlSpider
and want to extract data from website.
However, I always get redirected to the site's mobile version. I tried to change
the USER_AGENT
variable in scrapy's settings to Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
, but still get redirected.
Is there another way to signal another client and avoid redirection?
There are two types of redirection supported in Scrapy:
RedirectMiddleware
- Handle redirection of requests based on response statusMetaRefreshMiddleware
- Handle redirection of requests based on meta-refresh html tagSo, maybe your html page uses second type of redirection?
See also: