[pywikibot] Re: Working with wikitables

2022-12-21 Thread JJMC89
mwparserfromhell.nodes.tag.Tag can represent any HTML-style tag. mwparserfromhell will parse wikitext tables into the HTML tag equivalents

[pywikibot] Re: Working with wikitables

2022-12-21 Thread Bináris
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] Re: How to edit template parameters?

2022-12-21 Thread Kunal Mehta
Hi Roy, On 12/21/22 15:37, Roy Smith wrote: I see how I can find the existing {{DYK-Tools-Bot was here}}, with Page.templatesWithParams().  But once I've got that, how do I actually change the parameters in the wikitext? I would recommend using mwparserfromhell directly, which makes template

[pywikibot] Handling import errors

2022-12-21 Thread Bináris
In commons_information.py try: import mwparserfromhell except ImportError as e: mwparserfromhell = e try: import langdetect except ImportError: langdetect = None Later it examines if isinstance(mwparserfromhell, Exception): raise mwparserfromhell Why is it

[pywikibot] How to edit template parameters?

2022-12-21 Thread Roy Smith
I'm trying to implement the idea that was suggested in this edit. I see how I can find the existing {{DYK-Tools-Bot was here}}, with Page.templatesWithParams(). But once I've

[pywikibot] Re: Working with wikitables

2022-12-21 Thread JJMC89
You can use mwparserfromhell to filter the type of tag. wikicode = mwparserfromhell.parse(text) for table in wikicode.ifilter_tags(matches=lambda tag: tag.tag.lower()=="table"): wikicode.remove(table) On Wed, Dec 21, 2022 at 8:58 AM Bináris wrote: > Do we have anything to exclude tables

[pywikibot] Working with wikitables

2022-12-21 Thread Bináris
Do we have anything to exclude tables from page text? I read mwparserfromhell doc, but did not find. -- Bináris ___ pywikibot mailing list -- pywikibot@lists.wikimedia.org To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org

[pywikibot] Re: Pywikibot documentation

2022-12-21 Thread Bináris
Thank you, I could not follow the details, but anyway, that was a great work. Please help me understand the infrastructure. We have Manual:Pywikibot on mediawiki.org, which is a completely manual work. Quite independently, we have https://doc.wikimedia.org/pywikibot/, which should be partially?