I’m writing a bot for Wikipedia but have a problem. When I want to get stuff from another Wikimedia site I get the error – error-name ‘wikiquote’ is not defined.
This is when I start the code off like this-
import wikipedia
site = wikiquote.getSite()
Yet if I was to start it with wikipedia written instead of wikiquote, it works. From what I can understand it should work on other Mediawiki sites?
Help gratefully appreciated!
Thanks!
wikiquoteis not defined or imported anywhere in your script. So it is understandable that your code does not work.According to documentation of pywikipedia, you need to use this instead: