View Single Post
Old 08-13-2012, 09:47 PM   #5
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 328
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
There is clesarly some other issue with the recipe. As you can see from this Python session what I proposed does work.
Code:
C:\Python27>python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from BeautifulSoup import *

>>> x=BeautifulSoup('<html><body><div class="module bodytext">content</div></body></html>')
>>> print x
<html><body><div class="module bodytext">content</div></body></html>

>>> y=x.findAll('div','module bodytext')
>>> print y
[<div class="module bodytext">content</div>]

>>> for y in x.findAll('div','module bodytext'): y['class']='module'
...

>>> print x
<html><body><div class="module">content</div></body></htmt>
>>>

Last edited by nickredding; 08-13-2012 at 10:01 PM.
nickredding is offline   Reply With Quote