Hi,
I am trying to use a q number to get the details of a page in wikidata. I have searched through the tutorials and found these that claim to work
wikidata = pywikibot.Site("wikidata", "wikidata")
repo = wikidata.data_repository()
item = pywikibot.ItemPage(wikidata, "Q42").get()['claims']['P31'][0].getTarget()
itempage = pywikibot.ItemPage.fromPage(pywikibot.Page(pywikibot.Site("en", "wikipedia"), "Douglas Adams"))
However when I run either of these then I get the
EntityTypeUnknownException: DataSite("wikidata", "wikidata") does not support entity type "item"
As I am new to this and also python I am sure I am doing something stupid but its currently driving me mad.
Any help would be appreciated
Clemo
******************************************************************************************************************
Experience the British Library online at www.bl.uk<http://www.bl.uk/>
The British Library’s latest Annual Report and Accounts : www.bl.uk/aboutus/annrep/index.html<http://www.bl.uk/aboutus/annrep/index.html>
Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook<http://www.bl.uk/adoptabook>
The Library's St Pancras site is WiFi - enabled
*****************************************************************************************************************
The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you are not the intended recipient, please delete this e-mail and notify the postmaster(a)bl.uk<mailto:postmaster@bl.uk> : The contents of this e-mail must not be disclosed or copied without the sender's consent.
The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the British Library. The British Library does not take any responsibility for the views of the author.
*****************************************************************************************************************
Think before you print
I want to list pages in category A that are not in category B, so was
expecting a syntax like
python pwb.py listpages -ns:0 -cat:A -notcat:B -intersect -format:"{page.title}"
But as far as I can see listpages does not have a 'not category'
option. Is there another way I can do this?
BTW, I fixed my wikia problem, see
https://community.fandom.com/wiki/Thread:1881105
John