Login and accessing wikipedia API using pywikipedia
-
24-02-2021 - |
Pergunta
I am new to python. I have a task to access wikipedia. For this I am using the client pywikipedia to access mediawiki api. WHen I am running login.py it is asking me password. how will I get the password? has somebody worked on pywikipedia tool? Any suggestion which client can I use?
Solução
pywikipedia asks for your Wikipedia login. You can register an account on Wikipedia, as well as any other MediaWiki wiki, to assign your edits. When you use pywikipedia, it usually expects you to use an account (instead of editing anonymously).
Note that some wikis may have special requirements for people to run bots; some might require you to ask for a bot status first, and some might disallow you to make changes via the API (I don’t exactly know how it is done on Wikipedia, you’ll need to find that out yourself).
For configuration, please take a look at the user-config.py
file inside of the pywikipedia directory. This is where you define on which wiki you are working on (family
), and also which username to use (usernames[familyname][language]
).
See also:
- pywikipediabot on Meta
- pywikipediabot basics on Meta
- Wikipedia:Bots for general information about using bots on Wikipedia
- Wikipedia:Bot policy for rules your bot is required to follow