Ruby 中的图像抓取
如何使用 Nokogiri 抓取特定 URL 上存在的图像?如果有比 Nokogiri 更好的选择,请提出建议。 css图像标签是.profilePic img
How do I scrape an image present on a particular URL using Nokogiri? If there are better options than Nokogiri please suggest. The css image tag is .profilePic img
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果它只是一个带有 URL 的
![]()
:如果您需要将相对图像路径转换为绝对路径,请参阅:
https://stackoverflow.com/a/4864170/405017
If it is just an
<img>
with a URL:If you need to turn a relative image path into an absolute, see:
https://stackoverflow.com/a/4864170/405017
懒惰的方法是使用 mechanize,因为它会为你计算出 url 和文件名:
The lazy way is to use mechanize as it will figure out the urls and filenames for you: