I am trying to grab the monthly cost estimate using xpath on selenium but I am having a hard time getting the right value as there are two and possibly more div classes that define property taxes or home insurance. I have my code currently running:
principal_and_interest = (driver.find_element_by_xpath('.//div[@class="sc-Rmtcm GNsVX"]/span[@class="Text-aiai24-0 cJeryq"]').text)
but after running it over different listings, I see that some listings use a different div class name (see pictures to compare). My question is how do I get it so that it either takes into account both (or more div cases) or ,even better, a way that will look for 'principal_and_interest' despite the div classes being different?