Как мне взять это число в python scrapy - PullRequest
0 голосов
/ 21 июня 2020

фотография css

мой код:

def parse(self, response):
    score = response.css('div.twoRowExtra')

    for match in match:

        score1 = score.css('div.livescore.twoRowExtraRow:first-child span::text').extract()

        items['score1'] = score1


        yield items

всегда ответ - score1: []

1 Ответ

0 голосов
/ 22 июня 2020

Попробуйте эту функцию:

def parse(self, response):
    score = response.css('div.twoRowExtra')

    for match in score:
        score1 = match.css('div.livescore.twoRowExtraRow:first-childspan::text').extract()
        items['score1'] = score1
        yield items
...