最近在学习nodejs,在尝试写一个简单的爬虫,用http.get(url..)的形式,爬取'http://segmentfault.com/'的问题列表,但是,好像nodejs不支持htpps的网页?
报错如下:
Error: Protocol "https:" not supported. Expected "http:"
at new ClientRequest (_http_client.js:54:11)
at Object.exports.request (http.js:31:10)
at Object.exports.get (http.js:35:21)
at Object.<anonymous> (E:\1Javascript\node-study\bug\crawler.js:24:6)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
慕盖茨4494581
相关分类