• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem opening connection?  RSS feed

 
Nick Ueda
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have some code which is supposed to simply strip all the html source
off of a page and output it to the console.

But for some reason I can't explain, it won't work properly...it just
runs and doesn't display anything.
I works with some sites like http://www.netscape.com but not sites like
http://www.yahoo.com
why is this and is there a way to get this piece of
code to work universally?
Thanks,
Nick Ueda
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Content length is detrmined from the stream. Checking contentlength > 0 before getting the stream will always return false. Remove that if statement and try it again.
 
Nick Ueda
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow, thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!