If I have a Site or Page instance, how can I get the hostname of the site? In other words, I want:
site = Site('en', 'wikipedia') site.get_hostname() -> 'en.wikipedia.org'
The best I can come up with so far is page.full_url() and parse the hostname out of that, but that seems awkward (and possibly fragile)
https://doc.wikimedia.org/pywikibot/master/api_ref/family.html#family.Family...
Chatgpt is very good on these kinds of questions...
Strainu
Pe miercuri, 25 martie 2026, Roy Smith via pywikibot < pywikibot@lists.wikimedia.org> a scris:
If I have a Site or Page instance, how can I get the hostname of the site? In other words, I want:
site = Site('en', 'wikipedia') site.get_hostname() -> 'en.wikipedia.org'
The best I can come up with so far is page.full_url() and parse the hostname out of that, but that seems awkward (and possibly fragile) _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@ lists.wikimedia.org/message/E67YG2EDXEGXAAJTG4Z6A4Q4QDNZX26R/ To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org