Когда я 'URL-адрес оболочки scrapy', я получаю ответ с XPATH, но когда я пытаюсь запустить 'бот-сканер scrapy', нет.
Я уже пробовал .extract (),.get () и .getall ()
import scrapy
class AcicbotSpider(scrapy.Spider):
name = 'acicbot'
allowed_domains = ['www.acichapeco.com.br']
start_urls = ['https://www.acichapeco.com.br/associados/_busca_/?sc3=&c1&pg=0']
def parse(self, response):
#Extracting the content using xpath selectors
nomes = response.xpath('//*[@id="p1344"]/a[2]/label/text()').extract()
emails = response.xpath('//*[@id="tela"]/div/div[5]/a/text()').extract()
sites = response.xpath('//*[@id="tela"]/div/div[6]/a/text()').extract()
#Give the extracted content row wise
for item in zip(emails,sites):
#create a dictionary to store the scraped info
scraped_info = {
'nome':item[0],
'email':item[1],
'site':item[2],
}
#yield or give the scraped info to scrapy
yield scraped_info
Мне нужно извлечь название компании, адрес электронной почты и сайт, а также бот для сканирования следующих страниц: https://www.acichapeco.com.br/associados/busca/?sc3=&c1&pg=2