How to add random user agent to scrapy spider when calling spider from script?
How to add random user agent to scrapy spider when calling spider from script? Question: I want to add random user agent to every request for a spider being called by other script. My implementation is as follows: CoreSpider.py from scrapy.spiders import Rule import ContentHandler_copy class CoreSpider(scrapy.Spider): name = “final” def __init__(self): self.start_urls = self.read_url() …