binux / pyspider

A Powerful Spider(Web Crawler) System in Python.
http://docs.pyspider.org/
Apache License 2.0
16.48k stars 3.69k forks source link

unreadable code in response #847

Open ghost opened 5 years ago

ghost commented 5 years ago

Expected behavior

Actual behavior

How to reproduce

ghost commented 5 years ago

when I use requests.session().post(), response is readable: In altiore thema Amir Khusrau

Bug, when i use pyspider, response.text is readable code: à | Sa | Ÿà§ à | Puer | -§ ° | ¾à | ® a | | -১১ a | | § † ‡ ° | ªà§ a | | ° F ","চটৠটগৠরাম-১১ আসনের পৠর

ghost commented 5 years ago

Setting content-type in heades worked. headers = {'content-type': 'utf-8'} self.crawl(url='', data=post_data, headers=headers, timeout=120, callback=self.index_page, save={'start': start}, method="POST")