フィルタが付いているウェブサイトのデータを取得しようとしています。このウェブサイトは次のものです:https://www.lequipe.fr/Basket/RES_NBA.htmlスクラブでウェブサイトのフィルタを管理する方法
私は必要なすべての情報を収集するだけのスパイダーを持っていますが、表示されている日付のみです。
フィルタで使用可能なすべての日付のデータを収集するために、フィルタを反復処理する必要があります。
誰かが助けてくれればとっても感謝します。
私のクモは、このようなものです:
ので# -*- coding: utf-8 -*-
import scrapy
class LequipeBotSpider(scrapy.Spider):
name = 'Lequipe_bot'
allowed_domains = ['www.lequipe.fr/Basket/RES_NBA.html']
start_urls = ['http://www.lequipe.fr/Basket/RES_NBA.html']
#location of csv file
custom_settings = {
'FEED_FORMAT' : "csv",
'FEED_URI' : 'tmp/lequipe2.csv'
}
def parse(self, response):
#Extracting the content using css selectors
#recap = response.css(".equipeDom a::text,div.score span.score--chiffre::text,.equipeExt a::text").extract()
recap=response.css(".equipeDom a::text,div.score span.score--chiffre::text,.equipeExt a::text,div.equipeDom span.nba--ranking::text,div.equipeExt span.nba--ranking::text").extract()
#Give the extracted content row wise
for x in range(0,(len(recap))/6):
#create a dictionary to store the scraped info
scraped_info = {
'equipe_dom' : recap[1+6*x],
'score_dom' : recap[2+6*x],
'score_ext' : recap[3+6*x],
'equipe_ext' : recap[4+6*x],
'classement_dom' : recap[0+6*x],
'classement_ext' : recap[5+6*x],
}
#yield or give the scraped info to scrapy
yield scraped_info
、どのように私は@furasの溶液を用いてすべてのページの削れを繰り返すことができ、事前
あなたは、クラス= filtrecalendrier' '内のすべての日付を持っており、すべての日付は、詳細のページへのリンクがあります。問題はどこだ ? – furas