Hello,everybody~
我在用nodejs写爬虫的时候,想爬取图片(图片的地址:
http://img3.g.pptv.com/a/2015...但是老是提示:
<html>
<head><title>414 Request-URI Too Large</title></head>
<body bgcolor="white">
<center><h1>414 Request-URI Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
是指请求的链接过长。但是直接点击却是可以访问到图片的,怎么回事?请问大家这个怎么解决?或者是什么原因。先谢谢了~
这个是我请求的代码~多谢了
var request = require('request');
var fs = require('fs');
var picture_url = "http://img2.g.pptv.com/a/2015/12/14500834484095.jpg";
request(picture_url).pipe(fs.createWriteStream("../../../../abc"));
我利用superagent模块发起的get请求是能够正常获取到图片的。请问lz在发起请求的header或是方法?
补充:其实你只是差一个UA,爬虫请务必带上UA,不然太过明显