mwparserfromhell.nodes.tag.Tag
<https://mwparserfromhell.readthedocs.io/en/v0.6.4/api/mwparserfromhell.nodes.html#mwparserfromhell.nodes.tag.Tag>
can
represent any HTML-style tag. mwparserfromhell will parse wikitext tables
into the HTML tag equivalents
<https://en.wikipedia.org/wiki/Help:Table#Comparison_of_table_syntax>.

Doing something like the below will let you visualize:
>>> text = "before\n{| class='wikitable'\n!c1 h!!c2 h\n|r1 c1\n|r1
c2\n|}\nafter"
>>> for tag in wikicode.ifilter_tags(matches=lambda tag: tag.tag.lower() in
("table", "caption", "th", "tr", "td")):
...     print(f"{tag!r} is a {tag.tag!r}")
...
"{| class='wikitable'\n!c1 h!!c2 h\n|r1 c1\n|r1 c2\n|}" is a 'table'
'!c1 h' is a 'th'
'!!c2 h\n' is a 'th'
'|r1 c1\n' is a 'td'
'|r1 c2\n' is a 'td'

On Wed, Dec 21, 2022 at 5:04 PM Bináris <wikipo...@gmail.com> wrote:

> I don't find the description of objects and available tags in
> documentation, can you help me?
> Are there cells, rows, columns, headings?
> _______________________________________________
> pywikibot mailing list -- pywikibot@lists.wikimedia.org
> To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org
>
_______________________________________________
pywikibot mailing list -- pywikibot@lists.wikimedia.org
To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org

Reply via email to