beautifulsoup - I use pyparsing receive error Spider not found -


i'm try code script here: how can translate xpath expression beautifulsoup? receive error. can me, why error:

spider = self.crawler.spiders.create(spname, **opts.spargs) file "c:\python27\lib\site-packages\scrapy-0.16.5-py2.7.egg\scrapy\spidermanag er.py", line 43, in create   raise keyerror("spider not found: %s" % spider_name)  keyerror: 'spider not found: app' 

i installed pyparsing

thi code:

from pyparsing import makehtmltags, withattribute, skipto  import urllib  # html url  url = "http://www.whitecase.com/attorneys/list.aspx?lastname=&firstname=" page = urllib.urlopen(url)  html = page.read()  page.close()  # define opening , closing tag expressions <td> , <a> tags # (makehtmltags comprehends tag variations, including attributes,  # upper/lower case, etc.)  tdstart,tdend = makehtmltags("td")  astart,aend = makehtmltags("a")  # interested in tdstarts if have "class=altrow" attribute  tdstart.setparseaction(withattribute(("class","altrow")))  # compose total matching pattern (add trailing tdstart filter out  # extraneous <td> matches)  patt = tdstart + astart("a") + skipto(aend)("text") + aend + tdend + tdstart  # scan input html source matching refs, , print out text ,  # href values  ref,s,e in patt.scanstring(html):     print ref.text, ref.a.href 

thanks in advance! floriano


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -