Java, swt and web - java

How to retrieve all images from a site. I want to make desktop application which show images of a cars received by a web site.

You will need to do is get the HTML from the site you're connecting to and search for all the <img> tags, parse the url out of them, and then loop through each url, connect to it, download the image, then use your app to view the images.
Google is loaded with examples how to download files from urls.

Related

Possible to download a pdf from a website which has embedded pdfs

Screenshot of sriptI wanted to download the pdf on a website which is like in an embedded form with inbuilt pdf viewer.
Here is the sreenshot of it.
I tried going through the whole website but of no use

Extracting contents from a webpage and comparing using Java

I am developing a Java project in which i have a sub-module where i need to extract contents [text, image, color] from a webpage and compare it with another webpage. I am planning to use WinHTTrack software for downloading the webpage locally, but the problem is it doesn't save it as HTML. How can i download a webpage with HTML extension using softwares such as WinHTTrack [or just saving the webpage through ctrl+s is enogh.?]. Also i am planning to use HTML Parsers to extract the 3 content types[text, image, color],after downloading the webpage locally. So which parser to go with.?
WEll I use Httrack and it fetches html files as well. You are probably taking winhttrack project file as the only output file, but if you check inside the project directory there are html files (together with images, etc). I would suggest using - http://htmlparser.sourceforge.net/. It is a java library and since your project is a Java project it should be fairly easy to use it. You can also save the whole website locally using org.htmlparser.parserapplications.SiteCapturer (and specify whether resources such as images should be captured as well). Hope it helps.

library/code to accept images + text from user, and separately identify images as well as text(for storage)

Is there any library/code to show a box in which user inputs images + text in any order, and then the images and text are separately available (for storing into database eg Google Picasa web album or Windows Live Skydrive storage)?
I would prefer it if this can be done in java, however I am open to using javascript or jquery for this purpose.
Basically I want to store a web page section/article that contains images and text- I want to store the images in Picasa and data in Google App Engine's datastore.
One page in my web app will pull the pictures from picasa and dynamically add those to the text extracted from data store.
There is a library called JSON Engine that simplifies storing/retrieving text using JSON on App Engine, so I can use javascript or jquery for the above task... Or I can go with java (which is the language of my web app) ...

save webpages for offline browsing

i am trying to create an android application that saves webpages to use it in offline-browsing, i was able to save the webpage but the problem was in the contents (images, javascripts,..etc), is there a way to do so programmatically, i use eclipse and test my work on an emulator.
hm, I am afraid you should parse html's yourself (I mean do that with a properly lib) and store all resources (css, js, images, videos etc.) too.
s. how it is done in a java crawler: open source crawlers
You will need to search for all images, javascript files, css files, etc... and download them, saving them to the same relative path to the HMTL files - Assuming the html is coded with relative paths (images/image.png) and not absolute paths (http://www.domain.com/image/image.png).
You can pretty easily search the html string for <img, <script, <link etc.. and parse from there - or you can find a 3rd party html parser

How To download web page using java as well preserve image files

How to download the page and the images given the url using java. A similar question was avaialble already, which when tried just saves the page and not the images.
You'll have to download the page (HTML), then parse the HTML, find the <img> tags in there, and download the images (the src attribute of the <img> tag is the URL of the image file). Likewise you might want to download accompanying CSS or JavaScript files for the page.
Java makes it easy to copy files from a Web site

Categories

Resources