I'm trying to iterate through a list to extract information about businesses in google maps(name, address, and URL). My script selects the first result correctly but I can not extract anything from that result. I've tried explicit waits and various selectors(which I copied from inspecting the element). There has to be something that I just don't understand, I am pretty new to selenium so any help is appreciated.
Here is my current code
import csvfrom selenium import webdriverfrom selenium.webdriver.common.by import Byfrom bs4 import BeautifulSoup#from selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECfrom selenium.webdriver.support.ui import WebDriverWait as waitdriver = webdriver.Chrome() url = 'https://www.google.com/maps/search/Ace+Hardware'driver.get(url)#wait = WebDriverWait(driver, 10)# Locate and click on the link to the first search resultresult = driver.find_element(By.XPATH,'//*[@id="QA0Szd"]/div/div/div[1]/div[2]/div/div[1]/div/div/div[2]/div[1]/div[3]/div/a')result.click()page_content = driver.page_sourcewait(driver, 30).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[3]/div[8]/div[9]/div/div/div[1]/div[2]/div/div[1]/div/div/div[9]/div[3]/button/div/div[2]/div[1]')))url_element = driver.find_element(By.XPATH,'/html/body/div[3]/div[8]/div[9]/div/div/div[1]/div[2]/div/div[1]/div/div/div[9]/div[3]/button/div/div[2]/div[1]')url = url_element.textaddress_element = driver.find_element(By.XPATH,'//*[@id="QA0Szd"]/div/div/div[1]/div[3]/div/div[1]/div/div/div[2]/div[9]/div[3]/button/div/div[2]/div[1]')address = address_element.textprint(url)print(address)driver.quit()



