I need to scrape text in span class and I only want to store the text information I need.
Please see the HTML example below:
<div class="row">
<div class="col-md-2">
<span id="plcMain_lblBandNumber" class="control-label" style="font-weight: bold;">Number</span>
</div>
<div class="col-md-10">
<span id="plcMain_txtBandNumber" class="control-label">626</span>
</div>
</div>
<br />
The only text I need from the above HTML is 626.
Below is my python code:
import requests
from bs4 import BeautifulSoup
URL = "Link"
Page = requests.get(URL)
soup = BeautifulSoup(page.content,'html.parser')
results = soup.find(id = 'plcMain_textBandNumber')
print(results)
The result I got from the print statement is the HTML text below:
But I only want it to return the value of 626.