1

I ran a pywikibot sample code, but it is aborted due to AttributeError. Traceback is ...

Traceback (most recent call last):
  File "pwb.py", line 270, in <module>
    if not main():
  File "pwb.py", line 264, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 109, in run_python_file
    main_mod.__dict__)
  File ".\cochonBot.py", line 81, in <module>
    main()
  File ".\cochonBot.py", line 52, in main
    stub_list = cat_list_rec(u'遺꾨쪟:?좊쭑湲 遺꾨쪟', stub_ignore_cats)
  File ".\cochonBot.py", line 14, in cat_list_rec
    cat = catlib.Category(wikipedia.getSite(), top_cat)
AttributeError: 'module' object has no attribute 'getSite'
<type 'exceptions.AttributeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

what is the replacement of wikipedia.getSite()? or is it still usable?

H. Jang
  • 338
  • 3
  • 14

1 Answers1

1

You can simply use pywikibot.Site() instead.

framawiki
  • 242
  • 1
  • 10