Closed rodricios closed 5 years ago
I addressed the issue here: https://github.com/my8100/logparser/pull/3
It's weird that the Unicode signs appear here. Could you show the the screenshot of the complete log, including the content of print(text)
.
https://github.com/my8100/logparser/blob/5e531c25a6258d5ee3eb80e37a13b5482da6482d/logparser/common.py#L126-L131
Thanks for your feedback , the problem has been fixed in https://github.com/my8100/logparser/commit/b79a283ee7135527221e02dba5a90bb2982bee8b
BTW, the reason why Unicode signs appear in your log: https://github.com/scrapy-plugins/scrapy-crawlera/blob/87287b6a8e1b1069f782c722e803ce950946c22d/scrapy_crawlera/middleware.py#L183
crawlera_error = response.headers.get('X-Crawlera-Error')
if crawlera_error:
self.crawler.stats.inc_value('crawlera/response/error')
self.crawler.stats.inc_value(
'crawlera/response/error/%s' % crawlera_error.decode('utf8'))
Great, thanks!
Hi, as the subject line states,
parse_crawler_stats
throws an error when callingjson.loads
on a scraping job's stats dict whenever a key is printed with its unicode double string symbol.Stacktrace:
(stats dictionary was truncrated)