I am currently working on a web scraping project to extract data from the DoorDash website specifically for restaurants located in Chicago. The goal is to gather information about all the restaurant listings in the city, such as reviews, ratings, cuisine, address, and state.
Although the site is organized by different cities, I am solely focused on extracting data for Chicago. There are approximately 4,326 listings for restaurants in this city that I aim to capture in an Excel sheet.
My attempt to extract details like restaurant name, cuisine, ratings, and reviews using the class "StoreCard_root___1p3uN" has been unsuccessful so far. The output shows up as blank without any data being displayed.
from selenium import webdriver
chrome_path = r"D:\python project\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get("https://www.doordash.com/food-delivery/chicago-il-restaurants/")
driver.find_element_by_xpath("""//*[@id="SeoApp"]/div/div[1]/div/div[2]/div/div[2]/div/div[2]/div[1]/div[3]""").click()
posts = driver.find_elements_by_class_name("StoreCard_root___1p3uN")
for post in posts:
print(post.text)