Hey Jerry, I saw your post the other day and I am sorry I am on vacation and dont have access to my laptop. I believe I what I did was recreated a new spider with a different name and just pasted the code and it worked. My issue was because I changed the spider name and it was giving me issues. If you want paste your code into the forum and I will look at it to see if I can find any errors. On May 30, 2014 4:56 PM, "Jerry Wu" <[email protected]> wrote:
> Hi, Dc1981, > > Could you share any ideas of the reason why it happened? I am experiencing > the same problem. > > Thanks. > > On Tuesday, April 1, 2014 9:19:37 AM UTC+8, Dc1981 wrote: >> >> Issue resolved >> >> On Monday, March 31, 2014 6:50:35 PM UTC-4, Dc1981 wrote: >>> >>> The spiders folder is already name spiders with an "s" at the end. I am >>> using Ubuntu 13.10 not sure if this may have some thing to do with it. >>> >>> On Monday, March 31, 2014 4:05:02 AM UTC-4, Gianluca Tomasino wrote: >>>> >>>> Hi, >>>> >>>> I think that the folder for the spiders have to be renamed to spiders >>>> (with s) >>>> >>>> Gianluca >>>> >>>> Il giorno lunedì 31 marzo 2014 04:51:01 UTC+2, Dc1981 ha scritto: >>>>> >>>>> Forgot to mention I did rename my spider file to sbiz.py but that did >>>>> not work. >>>>> >>>>> On Sunday, March 30, 2014 10:42:40 PM UTC-4, Dc1981 wrote: >>>>>> >>>>>> Hello I am creating a scraper to pull info from sunbiz and I am >>>>>> getting the following error: *from sunbiz.items import SunbizItem >>>>>> ImportError: No module named items*. The items file does exist, its >>>>>> in the folder that I created for this project for example >>>>>> sunbiz/items.py. >>>>>> I have configured the file by creating objects. Below I have pasted my >>>>>> code. Not sure what I am doing wrong so any advice will be greatly >>>>>> appreciated. >>>>>> >>>>>> *items.py file* >>>>>> from scrapy.item import Item, Field >>>>>> >>>>>> class SunbizItem(Item): >>>>>> # define the fields for your item here like: >>>>>> # name = Field() >>>>>> company = Field() >>>>>> status = Field() >>>>>> pass >>>>>> >>>>>> *spider/sunbiz.py* >>>>>> from scrapy.spider import Spider >>>>>> from scrapy.selector import Selector >>>>>> from sunbiz.items import SunbizItem >>>>>> >>>>>> class SunbizSpider(Spider): >>>>>> name = "Sunbiz" >>>>>> allowed_domains = ['sunbiz.org'] >>>>>> start_urls = [ >>>>>> 'http://search.sunbiz.org/Inquiry/CorporationSearch/ >>>>>> SearchResults/EntityName/a/Page1' >>>>>> ] >>>>>> >>>>>> >>>>>> def parse(self, response): >>>>>> sel = Selector(response) >>>>>> sites = sel.xpath('//tbody/tr') >>>>>> items = [] >>>>>> for site in sites: >>>>>> item = SunbizItem() >>>>>> item["company"] = sel.xpath('//td[1]/a/text()').extract() >>>>>> item["status"] = sel.xpath('//td[3]/text()').extract() >>>>>> items.append(item) >>>>>> return items >>>>>> >>>>>> >>>>>> >>>>>> -- > You received this message because you are subscribed to a topic in the > Google Groups "scrapy-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/scrapy-users/wOc4BOiStwI/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/scrapy-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "scrapy-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/scrapy-users. For more options, visit https://groups.google.com/d/optout.
