lcf123

[其他] 采集小说时报错,大佬们知道怎么解决的吗

2019-06-10 11:31:10,867 [main] DEBUG org.yi.spider.helper.ParseHelper - 获取源文件, 目标地址: http://www.hk020.com/info/35462.html

2019-06-10 11:31:11,319 [main] DEBUG org.yi.spider.utils.HttpUtils - URL:http://www.hk020.com/info/35462.html,耗时:0

2019-06-10 11:31:11,762 [main] DEBUG org.yi.spider.utils.HttpUtils - URL:http://www.hk020.com/reader/35462/index.html,耗时:0

2019-06-10 11:31:11,765 [main] INFO  org.yi.spider.processor.NovelParser - 采集小说: 技能生成器,章节:第10章 冲突, 规 则:采集站

2019-06-10 11:31:12,260 [main] DEBUG org.yi.spider.utils.HttpUtils - URL:http://www.hk020.com/reader/35462/13440923.html,耗时:0

2019-06-10 11:31:12,263 [main] ERROR org.yi.spider.processor.NovelParser - 解析异常, 原因:null

java.lang.NullPointerException: null

        at org.yi.spider.helper.FileHelper.getTxtFilePath(FileHelper.java:138) ~[spider.jar:na]

        at org.yi.spider.helper.FileHelper.writeTxtFile(FileHelper.java:30) ~[spider.jar:na]

        at org.yi.spider.processor.NovelParser.collectChapter(NovelParser.java:477) [spider.jar:na]

        at org.yi.spider.processor.NovelParser.normalCollect(NovelParser.java:365) [spider.jar:na]

        at org.yi.spider.processor.NovelParser.parse(NovelParser.java:323) [spider.jar:na]

        at org.yi.spider.processor.NovelParser.proc(NovelParser.java:143) [spider.jar:na]

        at org.yi.spider.processor.NovelParser.prase(NovelParser.java:91) [spider.jar:na]

        at org.yi.spider.processor.MainParser.process(MainParser.java:66) [spider.jar:na]

        at org.yi.spider.processor.CmdProcessor.process(CmdProcessor.java:82) [spider.jar:na]

        at org.yi.spider.MainThread.run(MainThread.java:65) [spider.jar:na]

        at org.yi.spider.StartApp.main(StartApp.java:29) [spider.jar:na]


#1楼
发帖时间:6天前   |   查看数:0   |   回复数:1
lcf123
public static String getTxtFilePath(ChapterEntity chapter)
 {
   return
   
     GlobalConfig.localSite.getTxtFile().replace("#subDir#", String.valueOf(chapter.getNovelNo().intValue() / 1000)).replace("#articleNo#", String.valueOf(chapter.getNovelNo())).replace("#chapterNo#", String.valueOf(chapter.getChapterNo()));
 }

查看了一下报错代码是这一行
6天前 #2楼
游客组