我是 scraperwiki 的新手。我正在尝试使用 scraperwiki 从维基页面获取信息框。我得到了scraperwiki从链接下面抓取wiki页面的想法
https://blog.scraperwiki.com/2011/12/how-to-scrape-and-parse-wikipedia/
代码
import scraperwiki
wikipedia_utils = scraperwiki.swimport("wikipedia_utils")
title = "Aquamole Pot"
val = wikipedia_utils.GetWikipediaPage(title)
res = wikipedia_utils.ParseTemplates(val["text"])
print res # prints everything we have found in the text
infobox_ukcave = dict(res["templates"]).get("Infobox ukcave")
print infobox_ukcave # prints just the ukcave infobox
错误
Traceback (most recent call last):
File "scrap_wiki.py", line 3, in <module>
wikipedia_utils = scraperwiki.swimport("wikipedia_utils")
AttributeError: 'module' object has no attribute 'swimport'