Hi,
A document contains a section delimited by comments. How do you tell BeautifulSoup to limit searches to that section only?
To illustrate, the document looks like this:
<!--START-->
[...
this is the relevant section of the document. we want to perform searches that would search only here
...]
<!--END-->
How is this to be done with BeautifulSoup?
I was thinking about getting the indexes of the comments in the original string of the document, then getting just the relevant substring and making just that into a BeautifulSoup.BeautifulSoup instance.
But aside from this method being very ugly (the resulting substring would contain shards of broken elements etc.), I can't find the way to get the index of a BeautifulSoup.NavigableString.
Thanks for any pointers,
Xif