import pywikibot

from pywikibot import i18n, pagegenerators, Bot

from scripts.replace import main as mainReplaceBot
site = pywikibot.Site()
site
APISite("test", "wikipedia")
replace_texts = [
    {'from': 'di tahun', 'to': 'pada tahun'}
]

for replace_text in replace_texts:
    mainReplaceBot('-search:"' + replace_text['from'] + '"', replace_text['from'], replace_text['to'])
WARNING: /srv/paws/pwb/pywikibot/bot.py:856: UserWarning: Site objects have been created before arguments were handled
The summary message for the command line replacements will be something like: Bot: Automated text replacement  (-di tahun +pada tahun)
Press Enter to use this automatic message, or enter a description of the
changes your bot will make: 

Retrieving 41 pages from wikipedia:test.
Page [[File:Foto di tahun 2016.jpg]] not found
Page [[File:Ensiklopedi Adinegoro.jpg]] not found
Page [[File:Logo kujang.jpg]] not found
Page [[File:Situ Gintung 2014.jpg]] not found
Page [[File:Logo Arianacart.png]] not found
Page [[File:Jinny Oh Jinny OP Segment.jpg]] not found
Page [[File:GETAH 2016.jpg]] not found
Page [[File:Bendung Anai.jpg]] not found
Page [[File:Danau Bekas Tsunami di aceh, Alpen Indonesia.jpg]] not found
Page [[File:Pedoman Sunting 1 - Bab 1.pdf]] not found
Page [[File:Grave of Prof. Dr. Achmad Mochtar.jpg]] not found
Page [[File:Gedung garuda medan merdeka.jpg]] not found
Page [[File:Hotel Hyatt Regency Bandung (26988585143).jpg]] not found
Page [[File:Falco peregrinus ernesti.JPG]] not found
Page [[File:KRL 203-106F BOO106 10-car.jpg]] not found
Page [[File:Munawir Husni.jpg]] not found
Page [[File:Anjing bernyanyi papua.jpg]] not found
Page [[File:KRL Tokyo Metro 5817F 10-car.jpg]] not found
Page [[File:Merapi, Yogyakarta.jpg]] not found
Page [[File:Papuan singing dog.jpg]] not found
Page [[File:Gunung Merapi, Yogyakarta.jpg]] not found
Page [[File:Kampung Wisata Gedung Batin - Way Kanan - Yopie Pangkey - 3.jpg]] not found
Page [[File:KRL Toyo Rapid 1080F 10-car.jpg]] not found
Page [[File:COLLECTIE TROPENMUSEUM Het zwembad Kroeng Pantjo op Sabang TMnr 60018232.jpg]] not found
Page [[File:Wisma Kosgoro is Dead (30139567100).jpg]] not found
Page [[File:Sekolah Santa Maria (30054768852).jpg]] not found
Page [[File:Hyatt Regency Bandung (27263537945).jpg]] not found
Page [[File:Lambretta Li 150 I tipo a.JPG]] not found
Page [[File:COLLECTIE TROPENMUSEUM Groepsportret met onder meer J. Vink-Duiven en haar dochter Geesje voor het hek van het vliegveld Kemajoran TMnr 60049180.jpg]] not found
Page [[File:Peran Pemuda dalam Kebangkitan Film Indonesia (2009).pdf]] not found
Page [[File:COLLECTIE TROPENMUSEUM De heer en mevrouw Kool-Beijnen in hun rijtuig of deleman en de heer Kindermann met fiets op de Rode Brug in Buitenzorg TMnr 60013591.jpg]] not found
Page [[File:Ayo Berwirausaha.pdf]] not found
Page [[File:Modul Pelatihan II - Menyunting dengan Pywikibot.pdf]] not found
Page [[File:Modul Pelatihan 1 - Berkontribusi di Wikipedia Bahasa Indonesia.pdf]] not found
Page [[File:Modul Pelatihan 1 - Berkontribusi di Wikipedia Bahasa Indonesia - Penyuntingan Secara Manual.pdf]] not found
Page [[File:Konten Terbuka – Pedoman Praktis Penggunaan Lisensi Creative Commons.pdf]] not found
Page [[File:License Tutorial 7 Agustus 2015.pdf]] not found
Page [[File:Digging4data mencari data.pdf]] not found
Page [[File:Buku CMS ID Final.pdf]] not found
Page [[File:Tesis 'Strategi Pengembangan Kawasan Wisata Kepulauan Banda'.pdf]] not found
No changes were necessary in [[User:Om agus winanto]]

0 pages changed.
 
1
2
3