开发者

downloading only the header of a file

开发者 https://www.devze.com 2023-01-13 07:59 出处:网络
I\'m using mechanize for scraping a website which works nicely, however since you can\'t tell from a 开发者_开发百科link what kind of file it is linking to e.g. http://somesite.com/images.php?get=123

I'm using mechanize for scraping a website which works nicely, however since you can't tell from a 开发者_开发百科link what kind of file it is linking to e.g. http://somesite.com/images.php?get=123 is it possible to download only the header only?

It doesn't have to use mechanize but is there any Rails way of doing this?


Mechanize has the headers available after downloading a file. page.header['xxx'] or file.header['xxx'].

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号