Hi Ben,
Ben wrote:
> I'm on Windows [...]
>
be prepared for pain using mwlib in Windows, but that has been said
numerous times elsewhere ;)
> What I'm really looking for is something that parses
> wikitext the way that, say, lxml parses xml - returning a list or tree
> of elements that I can then work with.
>
>
To start playing around with the parser you could do something like this:
In [2]: from mwlib.uparser import simpleparse
In [3]: simpleparse("''italic text'', \n{|\n|-\n|table cell 1.1||table
cell 1.2|}")
Article
Paragraph tagname='p'->'p'
Style"''"
u'italic text'
Node
u', '
u'\n'
Table tagname='table'
Row tagname='tr'
Cell tagname='td'
u'table cell 1.1'
Cell tagname='td'
u'table cell 1.2'
u'\n'
Regards,
Volker
--
volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz
[email protected] http://www.brainbot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mwlib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/mwlib?hl=en
-~----------~----~----~----~------~----~------~--~---