Re: parsing contents of variable for a specific value...

From: Scaramouche (spamReallySucks_at_forgetit.com)
Date: 11/20/03


Date: Thu, 20 Nov 2003 21:49:52 GMT

thank you for taking the time to try and help out.
i thought the same thing and when i checked, endidx did contain a -1. this
is somewhat confusing since the spelling and case of the closing (</TITLE>)
tag is correct, i thought the slash might be throwing it off but since it's
a string i don't think that's it.
thanks again!

"nos" <nos@nospam.com> wrote in message
news:98avb.258761$Tr4.806047@attbi_s03...
> i would suggest you first check the result of the urlContent.indexOf()
> method invocations to see if you are getting -1 or null or whatever
> (some html pages use lower case)
>
> "Scaramouche" <spamReallySucks@forgetit.com> wrote in message
> news:o68vb.11938$M31.256257@twister.tampabay.rr.com...
> > i have the contents of an html page stored within a variable. i would
> like
> > to parse out the value of the TITLE tag,
> > ie..<TITLE>this_value_is_what_i_want</TITLE>
> >
> > String title=null;
> > int startidx=0, endidx=0;
> >
> > startidx = urlContent.indexOf("<TITLE>");
> > startidx += 7;
> > endidx = urlContent.indexOf("</TITLE>");
> > title = urlContent.substring(startidx, endidx);
> > System.out.println(title); //this doesn't work for me. generates an
> out
> > of bounds err msg.
> >
> > is there a way of doing this with java2...trying to stay away from xml
> since
> > it's new to me.
> >
> > thanks
> >
> >
>
>
>



Relevant Pages

  • Re: New URL spoofing bug in Microsoft Internet Explorer
    ... the single closing A tag should close the "current" A element - in this ... at this point - malformed html willing. ... from lower level nodes to parent nodes or whether mouseovers at the parent ...
    (NT-Bugtraq)
  • Re: Find & Replace Line Breaks with Paragraph Breaks
    ... That would work with the exception of the first opening tag and the last ... because in html a line break is only one item while ... >> The find and replace function would not know where to place the closing tag>> because there would be nothing to search for to replace it with. ... > paragraph and start a new paragraph") (in html is the equivalent ...
    (microsoft.public.frontpage.client)
  • Re: VIM Writing HTML
    ... HTML but have only just learnt about ... automaticaly complete the last opened tag by its closing version? ...
    (comp.editors)
  • Re: ruby html (or xhtml) forms class...
    ... xx is a library designed to extend ruby objects with html, xhtml, and xml ... xml or xhtml as clean looking and natural as ruby it self. ... attributes may be passed to any tag method as either symbol or string. ...
    (comp.lang.ruby)
  • Re: CSS Safari Problem (Mac)
    ... indirectly quoted, ... anything to say on my point: mixing HTML 4.01 and XHTML 1.0 is clueless. ... The closed meta tag was copied and pasted from Google's Webmaster ... But since this is Usenet, many likely are aware that the theme song ...
    (alt.html)