Hi Pedro, Try removing the rules, and naming your method "parse" instead of "parse_bomnegocio".
2014-12-12 19:31 GMT-02:00 Pedro Castro <[email protected]>: > > Hi Rócio and Nicolas. > > I'm "hard" confused. I changed the code for : > > from scrapy.contrib.spiders import CrawlSpider, Rule > from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor > from bomnegocio.items import BomnegocioItem > from scrapy.selector import HtmlXPathSelector > from scrapy.http import Request > from scrapy import log > import csv > import urllib2 > > class bomnegocioSpider(CrawlSpider): > name = 'bomnegocio' > allowed_domains = ["sp.bomnegocio.com/"] > start_urls = [ > " > http://sp.bomnegocio.com/regiao-de-bauru-e-marilia/eletrodomesticos/fogao-industrial-itajobi-4-bocas-c-forno-54183713 > " > ] > > rules = (Rule (SgmlLinkExtractor(restrict_xpaths=("//*[@id='ad_title']") > , callback="parse_bomnegocio", follow= True), > ) > def parse_bomnegocio(self,response): > item = BomnegocioItem() > item['title'] = response.xpath('//*[@id="ad_title"]/text()').extract()[0] > > return item > > Now the terminal say for me : > def parse_bomnegocio(self,response): > ^ > SyntaxError: invalid syntax > > > Why ? I change other things !!! > > Rocio I want to extract, primarily, the title "Fogão industrial itajobi 4 > bocas c/ forno" and subsequently the informations about the product. After > that, provide csv with the product information. > Nicolas I changed,but I do no what I must to do now. =( > > Em sexta-feira, 12 de dezembro de 2014 14h12min09s UTC-2, Pedro Castro > escreveu: > >> Hi, everbody. >> >> My question is the following : scrapy export empty csv. >> >> I try to post my code here, but became confused. >> >> My doubt on the stackoverflow : >> >> http://stackoverflow.com/questions/27447399/scrapy-export-empty-csv >> >> >> Thank you for your attention and I now look forward to hearing your views. >> >> -- > 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. > -- Rocío Aramberri -- 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.
