Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] 401 unauthorized, SaxBuilder

Espen Falkevik

2005-08-01

Replies:

Hi.
I'm trying to read a HTML page on a server, and to
parse it into a XML-dokument, so that I can use XPath
to extract the elements I want from the page.

The following code does the trick when the server
doesn't demand any authorizaiton:
(The code is written in Jython)

builder2 = SAXBuilder("org.ccil.cowan.tagsoup.Parser")
url = URL(http://10.0.0.1)
doc2 = builder2.build(url)
after this I can use XPath on doc2, to extract the
input and select fields...

My problem is: how can I do the same when the server
demands authentication? (when requesting the page in a
browser I get a pop-up where I write my username and
password). I don't want the user to get this popup, I
only want to declare my username and password as
strings in the program.....


Hope someone can help me

-Espen-


 
 
   
___________________________________________________________

Yahoo! Messenger - NEW crystal clear PC to PC calling
worldwide with voicemail http://uk.messenger.yahoo.com


   
___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.