I have a html code which shows time.
<span class="inner-2pZN4z">09:37:24 (UTC-4)</span>
Now this will change every second to show the correct time (I think it uses javascript to update the time, because I don't see any class change.). Now I want to take the time in my python code. So, I executed:
driver.find_elements_by_xpath("//span[@class='inner-2pZN4z']").text
This throws an exception:
Message: stale element reference: element is not attached to the page document
Edit
I went through How to disable Javascript when using Selenium? but disabling JavaScript for me will not work as there are other codes which need JavaScript.
Question: How can we disable/enable JavaScript in while executing python code using selenium chromedriver?