I'm trying to write and if/else statement if my find_element_by_xpath returns a valid element or not an
price = driver.find_element_by_xpath("//div[@class='price']").text
location = driver.find_element_by_xpath("//div[@class='listing__address']").text
if (SOMETHINGGOESHEREIFELEMENTEXISTS)
print(price, location)
driver.quit()
else:
print("QUITING!")
driver.quit()
In both cases I want to do a driver.quit.
thanks.