Quote:
Originally Posted by TonytheBookworm
If you have something like this:
how would you go about getting the text inside the p?
|
Without testing, my thoughts would be:
1) grab the parent of item (<p>) and extract() item, leaving a p with self.tag_to_string of what you want, or
2) perhaps, just grab item.next.next.next
I always need to test to be sure, but one of those should work.
edit: I see your post above, I tested it and they both work.
This worked best:
Code:
descr = item.parent
item.extract()
descr = self.tag_to_string(descr)