I am currently following the Python 3 Tutorial for Pywikibot and continue to experience attribute errors while running the included code from the tutorial as seen below.
import pywikibot
site = pywikibot.Site("en", "wikipedia")
page = pywikibot.Page(site, "Douglas Adams")
item = pywikibot.ItemPage.fromPage(page)
print(item)
While this is not the final step to achieve my goals, it has become a roadblock in my progression. From this code I should receive an output in the form of an ItemPage-object
however I only receive the following error:
site = pywikibot.Site("en", "wikipedia") # any site will work, this is just an example
AttributeError: module 'pywikibot' has no attribute 'Site'
I am quite new to programming and have only just scratched the surface, but I have taken some time to research attribute errors and how they may appear, as well as the fundamentals behind modules. At this point, however, I am pretty fried. Is it possible that my file/folder organization is causing this problem, or is there something more obvious that I am missing?
I am also wondering if I would be better off simply using a Wikipedia API to pull information and resources from Wikipedia/Wikidata for my project.
Thank you, please let me know if you need any more information.