A block of code on a website I'd like to use Selenium ( with Python ) on ( for web scraping ) looks like the following -
<div class="exp_date">
<span class="uppr_sec">
<i class="exp_clndr"></i>
<label> 04 Jan 2021 09:30 AM - 04 Jan 2021 10:30 AM </label>
</span>
<br>
<div class="clear"></div>
<span class="lwr_sec">
<i class></i>
<label>Hosted By Some Random Person</label>
</span>
</div>
I'd like to print the text enclosed in the <label>
tags in both the spans i.e. "04 Jan 2021 09:30 AM - 04 Jan 2021 10:30 AM" and "Hosted By Some Random Person" in the Python console, using Selenium. However, I am not sure about the steps to do so, because the labels are nested in their respective spans, which are nested in a div.
Can someone please help me out with the code needed to do so ? (in Python)