0

I am unable to scrap the span class using beautifulsoup

<div class="team-1-name">
           " 
                  India
                            "

                <span class="innings-1-score innings-current">120/1 (40.0 ov)</span>

        </div>

soup.prettify() is not even showing the span class.

print(soup2.prettify())

Output:

<div class="team-2-name">
     India
    </div>


team1_soup=soup2.find(class_="team-1-name")
print(team1_soup.find("span"))
None

Please Help

Harsh Seth
  • 5
  • 1
  • 1
  • 3

1 Answers1

0

The site you try to scrape add the tag <span class="innings-1-score innings-current"> using JavaScript (http://www.espncricinfo.com/navigation/cricinfo/ci/scorecard/js/min/templates.js?1453894715). You have also to use an headless browser like Selenium, PhantomJS or Splash to see it. See for example: scraping dynamic updates of temperature sensor data from a website

Community
  • 1
  • 1
Tomark
  • 369
  • 2
  • 7