http request, get html, parse it, print string... how best?

W

willykk

Hi folks,

Can someone point a hobby java beginner get some tutorial / sample /
code snippet that shows how to grab an url over http (html file), and
parse it to extract some information?. I'm looking for the most elegant
/ shorter path, btw: I'm trying to do this from a client-side java
app...

Say, I want to grab (http get) the url
http://www.host.com/data/something.cgi?param=blah&something=stuff

and get as a result all the information between <sometag> and
</someothertag> (or between '---something--' and '--somethingelse')
into a string?

what would be the best way to parse it? Are there any built-in HTML
parsers in J2SE 5.0 (say for instance I want to remove all html tags).

I haven't coded with java code in a long, long time and when I did, I
only dealt with local files, not network i/o (btw: I run Java apps
daily, like the beatiful swing-based Photomesa digital photo browser, I
just don't code 'em ;).

Thanks in advance, and sorry if this was the wrong newsgroup for such a
question...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top