爬虫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"})

 

posted @ 2017-11-02 14:00  大明湖畔的守望者  阅读(738)  评论(0编辑  收藏  举报