Skip to content

Unconsistant behavior while trying to get page.ns #512

@MorelElian

Description

@MorelElian

I am trying to fetch all pages in one category, I want to be able to just get if the current page is a category and I don't want to retrieve other information about it.
But before and after fetching the summary I don't get the same result:

Example:

import wikipediaapi 
wiki = wikipediaapi.Wikipedia(user_agent='MyProjectName (merlin@example.com)    ', language='en')
physics = wiki.page("Category:Physics")
print(physics.ns)
physics.summary
print(physics.ns)

Output:

0
14

Config:
Python 3.12.3
wikipediaapi 0.11

Does anyone knows how to fix it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions