1

I am newb to scraperwiki.I am trying to get infobox from wiki page using scraperwiki. I get the idea of scraperwiki to crawl wiki pages from below link

https://blog.scraperwiki.com/2011/12/how-to-scrape-and-parse-wikipedia/

Code

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

Error

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'
3ppps
  • 933
  • 1
  • 11
  • 24
  • 1
    What Python are you using ? Scraperwiki seems compatible only with Python 2.7(https://pypi.python.org/pypi/scraperwiki) A general consideration. This blog you cited is 3 years old and many things could have changed. Why not focus directly on scrapy and start by there ? – aberna Jan 27 '15 at 12:10
  • My python version is 2.7. How to crawl using scrapy? – 3ppps Jan 27 '15 at 12:25
  • http://doc.scrapy.org/en/latest/intro/overview.html there are many examples and there is support here on SO – aberna Jan 27 '15 at 12:27

0 Answers0