import pywikibot
site = pywikibot.Site('test', 'wikipedia')
site
APISite("test", "wikipedia")
page = pywikibot.Page(site, 'test')
page.exists()
True
page.text
'#REDIRECT [[Mnau]]'
page.text
'#REDIRECT [[Mnau]]'
page.text = 'Hello world'
page.save()
Page [[Test]] saved
page.text
'Hello world'
page.save()
Page [[Test]] saved
page.text
'Hello world'
site = pywikibot.Site('www', 'wikipedia')
---------------------------------------------------------------------------
UnknownSite                               Traceback (most recent call last)
<ipython-input-13-8eca61cd560f> in <module>()
----> 1 site = pywikibot.Site('www', 'wikipedia')

/srv/paws/pwb/pywikibot/__init__.py in Site(code, fam, user, sysop, interface, url)
    883     key = '%s:%s:%s:%s' % (interface.__name__, fam, code, user)
    884     if key not in _sites or not isinstance(_sites[key], interface):
--> 885         _sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop)
    886         debug(u"Instantiated %s object '%s'"
    887               % (interface.__name__, _sites[key]), _logger)

/srv/paws/pwb/pywikibot/site.py in __init__(self, code, fam, user, sysop)
   1855     def __init__(self, code, fam=None, user=None, sysop=None):
   1856         """Constructor."""
-> 1857         BaseSite.__init__(self, code, fam, user, sysop)
   1858         self._msgcache = {}
   1859         self._loginstatus = LoginStatus.NOT_ATTEMPTED

/srv/paws/pwb/pywikibot/site.py in __init__(self, code, fam, user, sysop)
    771             else:
    772                 raise UnknownSite(u"Language '%s' does not exist in family %s"
--> 773                                   % (self.__code, self.__family.name))
    774 
    775         self._username = [normalize_username(user), normalize_username(sysop)]

UnknownSite: Language 'www' does not exist in family wikipedia
site = pywikibot.Site('wikipedia')
---------------------------------------------------------------------------
UnknownSite                               Traceback (most recent call last)
<ipython-input-15-99ddaa36fc25> in <module>()
----> 1 site = pywikibot.Site('wikipedia')

/srv/paws/pwb/pywikibot/__init__.py in Site(code, fam, user, sysop, interface, url)
    883     key = '%s:%s:%s:%s' % (interface.__name__, fam, code, user)
    884     if key not in _sites or not isinstance(_sites[key], interface):
--> 885         _sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop)
    886         debug(u"Instantiated %s object '%s'"
    887               % (interface.__name__, _sites[key]), _logger)

/srv/paws/pwb/pywikibot/site.py in __init__(self, code, fam, user, sysop)
   1855     def __init__(self, code, fam=None, user=None, sysop=None):
   1856         """Constructor."""
-> 1857         BaseSite.__init__(self, code, fam, user, sysop)
   1858         self._msgcache = {}
   1859         self._loginstatus = LoginStatus.NOT_ATTEMPTED

/srv/paws/pwb/pywikibot/site.py in __init__(self, code, fam, user, sysop)
    771             else:
    772                 raise UnknownSite(u"Language '%s' does not exist in family %s"
--> 773                                   % (self.__code, self.__family.name))
    774 
    775         self._username = [normalize_username(user), normalize_username(sysop)]

UnknownSite: Language 'wikipedia' does not exist in family wikipedia
site = pywikibot.Site('en', 'wikipedia')