import pywikibot
site = pywikibot.Site('test', 'wikipedia')
site
APISite("test", "wikipedia")
page = pywikibot.Page(site, 'test')
page.exists()
True
page.text
'Hello world! --[[User:DannyS712 bot|DannyS712 bot]] ([[User talk:DannyS712 bot|talk]]) 22:30, 14 April 2019 (UTC)'
page.text = 'Hello world'
page.save()
Page [[Test]] saved
import pywikibot

site = pywikibot.Site('test', 'wikipedia')
page = pywikibot.Page(site, 'test')

page.text = 'Hello world!'
page.save()
Page [[Test]] saved