Tweaked : Re: [Htmlparser-user] HTMLParser 1.6 : Unexpected behavior in getNext/getPrevSibling()
Brought to you by:
derrickoswald
|
From: Madhur K. T. <mad...@gm...> - 2005-12-09 05:57:31
|
Hey,
Thanks Ian!! great!! That was a clear cut explanation... cool!!
Ok.. so suit my situation, at least, I've designed and implemented code
snippets, which would get the Previous and Next Node. I've attached code
for the same with this mail.
I've tested the code with many HTML pages. It works fine. In case
useful, the code is free to use, by anybody anywhere, but I expect that
you would preserve the ownership details.
Please, if possible, could anyone comment on the code with critics or
suggestions. One probably important thing is that I could start
supporting filters in the function (something like get me the previous
link node only).
I'm not sure of the procedures and standards but if this code with
whatever tweaks required could make it to some version of HTML parser,
I'll be obliged. I did not post it to the HTML Dev mailing list, since I
think that it would be too early to announce the code.
So, HTMLParser Users, I need your comments and suggestions.
Looking forward to comments,
Thanks,
Ian Macfarlane wrote:
>After that, it exits the loop, because prevSibling is now null.
>
>Why? Because this is the node structure (the formatting might not come
>out right, I'll also explain below):
>
>On 12/7/05, Madhur Kumar Tanwani <mad...@gm...> wrote:
>
>
>>>String : Unsubscribe
>>>Prev Sibling Txt (389[3,100],402[3,113]): Unsubscribe
>>>Next Sibling Txt (389[3,100],402[3,113]): Unsubscribe
>>>
>>>
>>I expected that the parser would treat the <A> tag and the <IMG> just before the text "Unsubscribe"
>>as siblings and wold return those.
>>
>>
--
__________________________
Madhur Kumar Tanwani
mad...@gm...
Ph.: 0253-5614792.
__________________________
Always remember that you are absolutely unique. Just like everyone else.
|