beautiful soup just get the value inside the tag

beautifulsoup, python

Solution

Extract the string from the element:

volume = soup.findAll("span", {"id": "volume"})[0].string

Problem

The following command: ``` volume = soup.findAll("span", {"id": "volume"})[0] ``` gives: ``` <span class="gr_text1" id="volume">16,103.3</span> ``` when I issue a print(volume). How do I get just the number?

Original source

Related problems