Kyokoning / lofter_crawler

crawler
43 stars 7 forks source link

当tag名为中文时会报错 #2

Closed fsouls closed 4 years ago

fsouls commented 4 years ago

EXTRA: TIME_STAMP: True OUTPUT_DIR: output/ TAG: ['马锈'] TARGET: ARTICAL: True HOT_THRE: 100 PICTURE: False TAG_MINUS: [] TAG_PLUS: [] TITLE: [] TYPE: tag USER: [] => get http://www.lofter.com/dwr/call/plaincall/TagBean.search.dwr failed 'latin-1' codec can't encode characters in position 26-27: ordinal not in range( 256) Traceback (most recent call last): File "tool/crawler.py", line 33, in save_tag(cfg, str(tag)) File "E:\Program files\lofter_crawler-master\tool..\lib\user_pigeonhole.py", line 199, in save_tag html = _get_html(POST_url, POST_payload, headers).text AttributeError: 'NoneType' object has no attribute 'text'

您好,试了几个中文名的tag会出现这个问题

Kyokoning commented 4 years ago

您好,非常感谢反馈!这是我没有充分测试的结果,盲区啊……发送给网址的POST请求如果是中文需要转码成url编码。已经修复bug的版本已经push上去了!