Hello,

def parser():

    from gluon.html import web2pyHTMLParser
    from gluon.sanitizer import sanitize

    folder = os.path.join(request.folder,'static')
    file = os.path.join(folder,'MYY.03.02.5.1.asp')
    source = open(file)
    html = source.read()


    tree=web2pyHTMLParser(html).tree

    elements=tree.elements(_class="BODYCONTENT")[1]

    return XML(TAG(elements[9]))

if I try it like that I get a ticket: 

AttributeError: '__tag__' object has no attribute 'decode'

if I put only:
   return XML(elements[9])

I get the text I want but with a couple of HTML tags that I'd wasning on using 
TAG to remove them.

<div class="bb"><a name="92912">Tässä artikkelissa käydään läpi tulevaisuuden 
sosiologisia </a>trendejä. Os...........sista.</div>


I'd like to the ridden of div claas and a name

Any ideas?


Kenneth

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to