wordOffset problem
Posted: Sun Feb 20, 2011 7:24 am
I'm trying to grab the URL on any given wikipedia page, for the "official website" shown in "External Links". I grab the HTML source for the wikipedia page in question and then am attempting to use the wordoffset to find the URL string. The URL I want is always preceeded by the code <li><span class="official website"> . So I search for this string first.
The problem I'm having: because the word official has no space between it and the quotation mark before it, wordoffset does not see official as a separate word. Ok - so then I search for the word official, including all the characters before it, up until the prior space. Which means I'm searching for <li><span class="official But wordoffset always returns zero, indicating it could not find anything. When gosh darn it I can obviously see that it is indeed there.
Because what I'm looking for contains a quotation mark, I can't include that in the string. So I construct the string to search for and put it into a variable. Such as put "<li><span class=" & quote & "official" into xHolder. I've checked by putting the string into the message window to make sure the string is as it should be, and it is. But again, wordoffset returns zero. Argggg.
Any and all advice on this greatly appreciated.
The problem I'm having: because the word official has no space between it and the quotation mark before it, wordoffset does not see official as a separate word. Ok - so then I search for the word official, including all the characters before it, up until the prior space. Which means I'm searching for <li><span class="official But wordoffset always returns zero, indicating it could not find anything. When gosh darn it I can obviously see that it is indeed there.
Because what I'm looking for contains a quotation mark, I can't include that in the string. So I construct the string to search for and put it into a variable. Such as put "<li><span class=" & quote & "official" into xHolder. I've checked by putting the string into the message window to make sure the string is as it should be, and it is. But again, wordoffset returns zero. Argggg.
Any and all advice on this greatly appreciated.