redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

jerichoHTML parser



 
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Has anyone had any experience with the jerichoHTML parser?
Http://jerichohtml.sourceforge.net/doc/index.html
Im trying to make my java prog access a web page that is behind a proxy at work
I have vpn'd in fine
But im wondering where i can state my un and pw for the proxy
I tried String sourceUrlString="http://user:pass@sample.com.au/index.php";
But still seem to be getting Exception in thread "main" java.io.IOException: Server returned HTTP response code: 401 for URL:
Any clues?
  Reply with quote


Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, you have to set the right headers instead of modifying the url
do you have ethereal or any other network sniffer available?
then install it.
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Ill have a look for a osx one
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, sniff the traffic from your web browser see what header it sets, sniff the trafic from your java program and see what it sets, fill in the missing ones
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
What am i trying to look for on the network?
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, most probably a Proxy-Authentication header...
unless your proxy uses NTLM and is microsoft only
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
No im on osx
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, note however that you get a 401 and not a 407 so I am not sure what your proxy expects
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
And im vpn in at the moment
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, ok, NTML works with IE (and that used to be available on mac)
still, install a good network sniffer and find out
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Im sorry im a little lost when u refer to header, what part of my java program is the header?
Ok ill grab that one
Im just wondering where im specifying that info in my java prog at the moment
Or how i specify it.
  Reply with quote


Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, if you are using URLConnection you have to set headers on it...
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Ok, it might have a default setting in the libraries somewhere already that was preset
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, URLConnection.setRequestProperty can be useful...
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
But basically ill have to make that header, match the one that i receive when i browse to the page normally?
Ok
Thanks heaps Nicolas Murphy
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, and please note that proxy-authentication headers of type Basic are base64 encoded
so they are just trivially scrambled clear text and trivial to get
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Trivial as in impossible?
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
Shirley Kidman, trivial as in very easy
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Ah
  Reply with quote
Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
you take 3 bytes and create 4 bytes, just some bit shifting
just to make sure that the string is 7 bit clean
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
Will this header file be different if logged on from different locations?
  Reply with quote


Nicolas Murphy



Joined: 30 Jun 2006
Posts: 12
probably not, depends on what header it is...
install a network sniffer so that you can find out
  Reply with quote
Shirley Kidman



Joined: 21 Jun 2006
Posts: 30
The programs is going to basically log into an online roster page, strip the html tags out and re format the text, eventually into a format that will import into ical
  Reply with quote
Page 1 of 1
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group