వాడుకరి:Arjunaraoc/pwb వాడి నిరర్ధక nowiki టేగ్ తొలగింపు అనుభవాలు/పైథాన్ కోడ్

from pywikiapi import wikipedia

# Connect to Telugu Wikipedia
site = wikipedia('te')

# Iterate over all query results as they are returned
# from the server, handling continuations automatically.
# (pages which have spurios <nowiki/> tags introduced by visual editor edits)
#gets pages which donot have edit restrictions of sysop
for page in (site.query_pages(prop='info',inprop='protection',generator='search',gsrsearch='insource:"nowiki" insource:/wiki\/>/',gsrlimit=30)):
    if (page['protection']):     
       for val in page.protection:
          if val['type']!='edit':
                pass
          elif val['type']=='edit' and val['level']=='sysop':
                pass
          else:    
             print("[["+page.title+"]]")
    else:
       print("[["+page.title+"]]")