Sections and subsections treated differently, is this API or mwclient?
See original GitHub issueSeeing issue when using page.text(section=x)
Consider following page:
== Section 1 ==
stuff
=== Subsection 1 ===
sub stuff
== Section 2 ==
stuff stuff
page.text(section=1) is
== Section 1 ==
stuff
=== Subsection 1 ===
sub stuff
page.text(section=2) is
=== Subsection 1 ===
sub stuff
Why is asking for section=1 including section=2?
Is this mwclient code issue or Mediawiki API problem?
Info: mwclient 0.8.1, python 2.6.6, Mediawiki 1.23
Considering how TOC is presented by Mediawiki, it makes sense to use floats, so sections are 1, 1.1 and 2.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Source code for mwclient.page - Docs
Source code for mwclient.page ... Built with Sphinx using a theme provided by Read the Docs. Read the Docs v: latest.
Read more >get all sections separately with wikimedia api - Stack Overflow
I try to get all seperate sections of a ...
Read more >explain xkcd talk:Community portal/Proposals
There are some suggestions on how to organize the community portal here (basically using subpages for different purposes, ...
Read more >mwclient Documentation - Read the Docs
Mwclient is a MIT licensed client library to the MediaWiki API that should work well with both Wikimedia wikis and.
Read more >Debian -- Software Packages in "sid", Subsection python
Software Packages in "sid", Subsection python ... python3-mwclient (0.10.1-2): MediaWiki API client in Python; python3-mwoauth (0.3.7-4) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
True, it’s a MediaWiki thing… I think it would be confusing to make a custom implementation in mwclient.
But note that you can get helpful TOC information from
prop=sections
, includingPerhaps we should add a
sections()
method on thePage
object to simplify getting that information?Closing this issue. Feel free to open a new issue if you have ideas on how mwclient could make it easier to work with sections without breaking api compability. As mentioned, I’m considering adding
.sections()
toPage
.