Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- class MySpider(scrapy.Spider):
- name = 'MySpider'
- start_urls = [
- 'https://www.app4health.it/',
- ]
- def parse(self, response):
- self.logger.info('A response from %s just arrived!', response.url)
- print ('PRE RISULTATI')
- risultati = response.selector.xpath('//*[@id="nav"]/ol/li[*]/a/@href').extract()
- #risultati = risultati = response.css('li a>href').extract()
- # QUESTO SULLA CONSOLE WORKA, QUANON VA NULLA
- #risultati = response.xpath('//*[@id="nav"]/ol/li[1]/a').extract()
- print (risultati)
- #for pagineitems in risultati:
- # next_page = pagineitems
- print ('PAGINA SUCCESSIVAAAAAAA')
- #LO IGNORA PERCHE DICE CHE E' GIA STATA RICHIESTA
- yield scrapy.Request(url=risultati, callback=self.prodotti,dont_filter = True)
- def prodotti(self, response):
- self.logger.info('A REEEESPONSEEEEEE from %s just arrived!', response.url)
- return 1
- response.selector.xpath('//*[@id="nav"]/ol/li[*]/a/@href').extract()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement