You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import mwparserfromhell
f = open('page.txt', 'r', encoding='utf-8')
text = f.read()
f.close()
code = mwparserfromhell.parse(text)
for template in code.filter_templates():
print(template)
then be print only a few recognized templates, e.g. be skip all bibliographic templates.
On pages with tables parser don't find templates, and has writes in tables the bad char '|'.
E.g. page: https://ru.wikipedia.org/wiki/%D0%A8%D0%BF%D0%B8%D1%86%D0%B1%D0%B5%D1%80%D0%B3%D0%B5%D0%BD When parser run on text of this page with the code
then be print only a few recognized templates, e.g. be skip all bibliographic templates.
And this code add in tables '|' like:
if save the file:
The text was updated successfully, but these errors were encountered: