如何以编程方式从网站下载图片? [英] How to programmatically download image from website?

查看:152
本文介绍了如何以编程方式从网站下载图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从网站下载图片,并且我有登录名和密码,但如果我只是使用URL来下载图像,那么它会抛出一个例外:会话中没有价值。

I need to download images from a website, and I have the login name and password, but if i just use URL to download the image, it will throw a exception: there is no value in session.

我想我需要登录网站,然后才能以编程方式下载图片。

I think I need to login the website before I can programmatically download the image.

您有任何解决方案吗?感谢提前!

Do you have any solutions ? Thanks in advance !

推荐答案

我想提一下 HtmlUnit 。它是一个无脚本的JavaScript用于Java的浏览器。

I'd like to mention HtmlUnit. It is a headless browser with Javascript for Java.

这篇关于如何以编程方式从网站下载图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆