爬虫header和cookie

1 def on_start(self):
2     self.crawl('http://bbs.byr.cn/board/Python',
3                headers={'X-Requested-With': 'XMLHttpRequest'},
4                callback=self.index_page)
5 
6     self.crawl(url, callback=self.index_page, cookies={"tt_webid":"6469594619403077134"})
原文地址:https://www.cnblogs.com/wangzhisdu/p/7771960.html