satrong / node-webcrawler

网页版nodejs爬虫工具

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

在windows下测试,不能下载图片!

miaogong opened this issue · comments

1、首先在linux下测试,首页能显示。点爬取按钮后,没有任何反应。
之后修改了配置,把文件路径修改为linux下,也没有反应。

2、下载网盘文件,在windows下测试,点爬取按钮后,可以抓取到列表页面,并进行分析。
但是到下载图片的时候,显示“准备下载到本地中...”
之后没有反应。

请问应该是什么问题?

                                                     ^

TypeError: Cannot read property '0' of null
at E:\host\node-webcrawler\lib\crawler.js:246:58
at iterate (E:\host\node-webcrawler\node_modules\async\lib\async.js:149:13)
at Object.async.eachSeries (E:\host\node-webcrawler\node_modules\async\lib\a
sync.js:165:9)
at Crawler.dlImage (E:\host\node-webcrawler\lib\crawler.js:245:11)
at E:\host\node-webcrawler\lib\crawler.js:220:22
at Request._callback (E:\host\node-webcrawler\lib\crawler.js:303:9)
at Request.self.callback (E:\host\node-webcrawler\node_modules\request\reque
st.js:344:22)
at Request.emit (events.js:110:17)
at Request. (E:\host\node-webcrawler\node_modules\request\request
.js:1239:14)
at Request.emit (events.js:129:20)

你好,可能是E:\host\node-webcrawler\lib\crawler.js文件中246行的正则匹配出现问题

var filename = item.url.match(/[^\/]+\.\w{3,4}$/)[0];

这句可能需要根据你的实际情况改下。

Linux下没进行过测试,抱歉。

@miaogong
你好,我修正一些BUG,欢迎继续关注使用