Is there any way to get the parsoid HTML for a page? It looks like Page.get_parsed_page() gets the output from the legacy parser.
Presently, no.
For PWB to have a function for this, it needs to be able to get the parsoid HTML from MediaWiki's API. MediaWiki's legacy API (the action=query one) doesn't have an endpoint for this purpose. MediaWiki's newer REST API does, and https://phabricator.wikimedia.org/T413705 plans to add support for the REST API to PWB, but I haven't seen any progress there.
On Sun, Apr 12, 2026 at 1:01 PM Roy Smith via pywikibot < pywikibot@lists.wikimedia.org> wrote:
Is there any way to get the parsoid HTML for a page? It looks like Page.get_parsed_page() gets the output from the legacy parser. _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org
OK, thanks. For the moment, I'm doing:
def get_parsoid_html(article: Page) -> str: request = article.site.simple_request( action="parse", format="json", page=article.title(), parser="parsoid", formatversion=2, ) data = request.submit() return data["parse"]["text"]
which seems to work. Adding an optional parser: str to Page.get_parsed_page() and the underlying Site call seems like it would be pretty simple and save some user effort.
On Apr 12, 2026, at 3:09 PM, Huji Lee huji.huji@gmail.com wrote:
Presently, no.
For PWB to have a function for this, it needs to be able to get the parsoid HTML from MediaWiki's API. MediaWiki's legacy API (the action=query one) doesn't have an endpoint for this purpose. MediaWiki's newer REST API does, and https://phabricator.wikimedia.org/T413705 plans to add support for the REST API to PWB, but I haven't seen any progress there.
On Sun, Apr 12, 2026 at 1:01 PM Roy Smith via pywikibot <pywikibot@lists.wikimedia.org mailto:pywikibot@lists.wikimedia.org> wrote:
Is there any way to get the parsoid HTML for a page? It looks like Page.get_parsed_page() gets the output from the legacy parser. _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org mailto:pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org mailto:pywikibot-leave@lists.wikimedia.org
I started to take a look at doing this. I started by pulling down the source and running the tests. I was surprised at how long the tests took to run (on my M2 Mac Mini) and how many failures there were:
23 failed, 1773 passed, 164 skipped, 13 xfailed, 32 warnings in 12441.65s (3:27:21)
Is this normal?
On Apr 12, 2026, at 3:17 PM, Roy Smith roy@panix.com wrote:
which seems to work. Adding an optional parser: str to Page.get_parsed_page() and the underlying Site call seems like it would be pretty simple and save some user effort.
I haven't run the tests locally in a while (shame on me?) because the CI on Gerrit is always so good. I do think that some of our tests depend on testwiki and I think I saw a report recently indicating that high replag has been disrupting some PWB CI tests or made them slower.
On Tue, Apr 14, 2026 at 9:23 AM Roy Smith roy@panix.com wrote:
I started to take a look at doing this. I started by pulling down the source and running the tests. I was surprised at how long the tests took to run (on my M2 Mac Mini) and how many failures there were:
23 failed, 1773 passed, 164 skipped, 13 xfailed, 32 warnings in 12441.65s (3:27:21)
Is this normal?
On Apr 12, 2026, at 3:17 PM, Roy Smith roy@panix.com wrote:
which seems to work. Adding an optional parser: str to Page.get_parsed_page() and the underlying Site call seems like it would be pretty simple and save some user effort.
OK, so following the instructions:
Anyone can get a Developer account. Once you've registered, if you're interested in working on Pywikibot, please email the mailing list and introduce yourself and mention what you'd like to work on, so other people can greet you.
I had a dev account (RoySmith on phab, roysmith on toolforge). Allow me to introduce myself: I'm Roy, I maintain a few pyrhon-based tools on toolforge. Most of my older stuff used mwclient, but I've been moving to pwb for my newer projects. There's a lot of improvements I'd like to make, but for now I'll be happy to just add parsoid support. Now, if I understand the instructions properly, you all are supposed to greet me :-)
I mostly live in github. It'll take me a little time to get up to speed on gerrit. If I understand things correctly, the plan is to not bother running tests locally, just check in a patch on my private branch and wait for the CI to run? That seems like an odd way to do things, but if that's what people do, I can handle that.
On Apr 14, 2026, at 8:06 PM, Huji Lee via pywikibot pywikibot@lists.wikimedia.org wrote:
I haven't run the tests locally in a while (shame on me?) because the CI on Gerrit is always so good. I do think that some of our tests depend on testwiki and I think I saw a report recently indicating that high replag has been disrupting some PWB CI tests or made them slower.
On Tue, Apr 14, 2026 at 9:23 AM Roy Smith <roy@panix.com mailto:roy@panix.com> wrote:
I started to take a look at doing this. I started by pulling down the source and running the tests. I was surprised at how long the tests took to run (on my M2 Mac Mini) and how many failures there were:
23 failed, 1773 passed, 164 skipped, 13 xfailed, 32 warnings in 12441.65s (3:27:21)
Is this normal?
On Apr 12, 2026, at 3:17 PM, Roy Smith <roy@panix.com mailto:roy@panix.com> wrote:
which seems to work. Adding an optional parser: str to Page.get_parsed_page() and the underlying Site call seems like it would be pretty simple and save some user effort.
pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org