View Single Post
Old 09-18-2010, 08:43 AM   #2756
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by TonytheBookworm View Post
If you have something like this:
Spoiler:

Code:
<p>
<a class="article" href="/ReadArticle.aspx?ArticleID=22529">Identifying Your Future Leaders</a>
THIS IS SOME PRETTY TEXT I WOULD LIKE TO CAPTURE.
</p>

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)

Last edited by Starson17; 09-18-2010 at 10:07 AM.
Starson17 is offline