geek_crawler icon indicating copy to clipboard operation
geek_crawler copied to clipboard

个别专栏爬取报错

Open outlawsoflove opened this issue 4 years ago • 1 comments

报错信息: File "geek_crawler.py", line 483, in save_to_file with open(file_path, 'w', encoding='utf-8') as f: OSError: [Errno 22] Invalid argument: 'D:\0-git-time\geek_crawler-master\JavaScript核心原理解析\20 _ (0, eval)("x = 100") :一行让严格模式形同虚设的破坏性设计(上).md'

大神要不要看看

outlawsoflove avatar Sep 01 '20 08:09 outlawsoflove

@outlawsoflove 从日志上看应该是这篇文章的标题在极客原数据中存在特殊字符(20 _ (0, eval)("x = 100") :一行让严格模式形同虚设的破坏性设计(上).md),而我的程序代码中是直接拿的极客接口返回的数据,没有做特殊处理,导致保存成文件名的时候报错。这应该是一个bug,需要保存成文件名的时候把特殊字符处理掉(目前只做了部分特殊字符的处理),后续如果有时间再修复这个问题

zhengxiaotian avatar Sep 13 '20 06:09 zhengxiaotian