A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
Webpage source code
Joined: Feb 09, 2006
Apr 07, 2006 13:01:00
Is there any way to get a webpages source code using
? For example I want my jsp page to get the source code of lets say
and write it to a file, how can I do this? thanks.
Joined: Sep 23, 2004
Apr 07, 2006 13:25:00
Your best bet would be to look at
Apache Commons HttpClient
library. This makes it very simple to get a URL. It also handles things like cookies and authentication.
<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Joined: Mar 22, 2005
Apr 07, 2006 13:40:00
And of you want to process the page you got, have a look into HttpUnit (on SourceForge), which will give you a DOM view of the page. That way you can use the DOM API or XPath to get at the contents of the page.
I agree. Here's the link:
subject: Webpage source code
Q for Kathy & Bert
Server URL call issues in jsp/struts
"Type mismatch: cannot convert from Cookie to String"
Creating Java classes on fly
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015