I am trying to fill-up page numbers of a Book in its Index Wikisource page. The following code writes well in the specific pageNumber parameter.
If the page is empty, it looks fine. But if i run the code another time, due to the concatenation the 67 becomes 6767. How can i know that the pageNumber parameter ('|Number of pages='
) is empty? or If the parameter already filled how can i set the skip option in the code.
The writing code;-
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pywikibot
indexTitle = 'அட்டவணை:தமிழ் நாடகத் தலைமை ஆசிரியர்-2.pdf'
indexPages = '67'
site1 = pywikibot.Site('ta', 'wikisource')
page = pywikibot.Page(site1, indexTitle)
indexTitlePage = page.text.replace('|Number of pages=','|Number of pages='+indexPages)
page.save(summary='67')