This is the element:
<div class="_4lg0 _4lg5 _4h2p _4h2m" style="height: 64px; width: 134px; left: 950px;"><div class=" _1b33 _e9h"><div class="_e9n"><div class=""><div class="ellipsis _1ha3" geotextcolor="value" data-hover="tooltip" data-tooltip-display="overflow" data-tooltip-text-direction="auto"><span class="_3dfi _3dfj">₹50,316.27</span></div><div class="ellipsis _1ha4" data-hover="tooltip" data-tooltip-display="overflow" data-tooltip-text-direction="auto">Total Spent</div></div></div></div></div>
This is code I have tried until now:
spend_element = driver.find_element(By.CSS_SELECTOR, "div.ellipsis. _1b33 _e9h")
ad_spend = spend_element.find_element(By.XPATH, "//span[contains(@class, '_3dfi') and contains(@class, '_3dfj')]").text
The Problem is there is a similar element with same span class.
Can someone tell how I can scrape this element exactly?
enter image description here
Thanks!
New contributor
Ansh Arora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.