1

I am trying scrape data from this page https://www.flashscore.co.uk/cricket/.

Home teams have either of the following attributes:

<div class="event__participant event__participant--home">KSKS</div>

<div class="event__participant event__participant--home fontBold">Legends of Rupganj</div>

I had thought the following would allow me to use a partial match to scrape all home teams but it does not return any results. There are no errors.

homeTeam = container.find('div[class*="event__participant event__participant--home"]').text if container.find('div[class*="event__participant event__participant--home"]') else ''

What am I doing wrong?

Andy
  • 509
  • 2
  • 7

1 Answers1

1

In Selenium-Python I would do something like this :

for home_team in driver.find_elements(By.CSS_SELECTOR, "div[class*='event__participant event__participant--home']"):
    print(home_team.text)

and that gave me the below O/P :

Sydney Sixers
Perth Scorchers
Brisbane Heat
Sydney Sixers
Brisbane Heat
Melbourne Stars
Melbourne Renegades
Brisbane Heat
Adelaide Strikers
Sydney Sixers
Sydney Thunder
cruisepandey
  • 28,520
  • 6
  • 20
  • 38