0

我正在使用 scraperwiki 在 Python 中运行一些代码。但是,当我运行此代码时,我收到此错误:

Traceback(最近一次调用最后一次):文件“./code/scraper”,第 4 行,在 from scrapemark import scrape ImportError: No module named scrapemark

这是代码:

import scraperwiki
from scrapemark import scrape
import scraperwiki

for page in range(1,40):
  URL = "https://appexchange.salesforce.com/results?pageNo="+str(page)+"&filter=a0L3000000OvSOGEA3" #Marketing

  print URL
  html = scraperwiki.scrape(URL)
  scrape_data = scrape("""
   {*

   <a class="tile-title" href="{{ [mobile].[link] }}" id="{{ [mobile].[id] }}" title="{{ [mobile].[title1] }}"></a>

   *}
   """, html=html);

  data = [{'Title':p['title1'][0], 'URL':p['link'][0], 'ID':p['id'][0], 'Format':'Managed'} for p in scrape_data['mobile']]

  scraperwiki.sqlite.save(unique_keys=["URL"], data=data)

谁能告诉我如何解决这个问题?

4

0 回答 0