简体   繁体   中英

How can i take this number in python scrapy

photo of css

my code:

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

always response is score1:[]

Try this function out:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM