Question

i'm not going to post any code here because i don't know how to start doing it. Actually I need your help...

I am working with java (using netbeans, btw) and I have a database with multiple urls in a table (MySQL), and i want to get a screenshot of every url listed there, save it to my pc and then insert that screenshot (jpeg) in the url table. I was looking here on stackoverflow but i had no answer (not an automatic one, because i have to open a web browser and the aplication is supposed to be a standalone app) (The other option i found in this article -> (this) is unavailable.

In the same article i've read about the Flying Saucer Project, and maybe is the best option, but i have no idea of how to use it and i don't want to waste valious time reading every single thing that the project can do... so i'd appreciate a quick tutorial of how to use it.

Please, if u can post some code here would be great, but at least i'd like an answer of how to do this, or mambe some suggestions, that would be nice too. THANKS EVERYBODY.

Was it helpful?

Solution

You should take a look at CutyCapt:

CutyCapt is a small cross-platform command-line utility to capture WebKit's rendering of a web page into a variety of vector and bitmap formats, including SVG, PDF, PS, PNG, JPEG, TIFF, GIF, and BMP. See IECapt for a similar tool based on Internet Explorer.

Just execute the application from within your Java application. See Running Command Line in Java. The result would be something like::

p = Runtime.getRuntime().exec(String.format("./CutyCapt --url=%s --out=%s",
        url, path));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top