I realize that setting isPublic to false actually does not solve my problems :( There is something wrong in my local settings… But… Thank you so much JJMC89 !!! This works :
import pywikibot as pwb import pywikibot.pagegenerators as pwbpg
site = pwb.Site()
def get_page_by_id(site, id): res = None for pg in pwbpg.PagesFromPageidGenerator(str(id), site): if res == None: res = pg else: raise Exception("Too many results") #probably useless return res