How to scrape Uber Eats using Selenium and Beautiful Soup?

February 23, 2022

Web scraping is a technique that allows you to extract information from any website without the need to submit a form. This tutorial will show you how to scrape your UberEats data using Selenium and Beautiful Soup, then import it into Excel so that you can better analyze your business. Whether you're an entrepreneur trying to figure out how much time and effort goes into churning out meals or a chef trying to make changes in the kitchen based on data, this is an essential step in taking your restaurant forward.

This article should help everyone interested in understanding UberEats restaurant data scraping, give them some demo code, and walk through what's needed for successful implementation with Selenium and Beautiful Soup.

There are multiple ways to solve the problem of data extraction, and this way could be better. We provide one sample input and output that may help those interested in learning web scraping.

Benefits of scraping UberEats


The business model for many ridesharing companies is built on machine learning and data analysis to increase ridership and reduce costs.

Uber Eats is becoming increasingly popular, providing an excellent service to the end user while benefiting restaurants that are always looking for another source of revenue. By analyzing the behavior of the user, restaurant, and delivery person, machine learning algorithms can predict what type of food to order, when it's busy, and which delivery person is best suited to do the job.

1. Learning your customer behavior:

Knowing what consumers order and how much of it will help you understand their tastes and also allow you to suggest new dishes.

2. Learning delivery person habits:

Selenium can be used to determine the time between the restaurant and the customer, which is especially important when calculating food spoilage. Exact information on delivery times allows restaurants to serve better those customers who want their food faster.

3. Learning the restaurant's response patterns:

The more data you have, the easier it will be to figure out how your business changes over time and predict how it will work in the future. It allows you to start working on solutions for problems before they arise.

4. Testing new ideas or product offerings:

Before you spend your time and money trying out a new idea, it's best to see if there's demand for it.

In this article, we'll use Selenium to scrape the website UberEats and extract information about the location, the category of food ordered, and its cost. Then, we'll use Beautiful Soup to parse the HTML code removed by Selenium and import it into Microsoft Excel.

Background Knowledge of Selenium


Selenium is a tool used to automate web browsers, and it's primarily built for testing purposes. Instead of having to actually click each element and move around through a website by hand, you can program in some logic to do these tasks for you.

Understanding Beautiful Soup


Beautiful Soup is a python module that helps parse HTML and XML into something more readable. It is a partial tutorial on Beautiful Soup, but I'll be sharing some tips on how to get successful web scraping results with it.

Using Selenium and Beautiful Soup to scrape UberEats

Part 1: Creating a Firefox profile with Selenium to access UberEats

1. Download and install Firefox from the official website. I'm using Firefox ESR and recommend that you do, too, for the stability of the environment.

This tutorial is for Windows users, but Mac or Linux versions are available on their websites. Download a version appropriate for your operating system and install it according to these instructions. The next step will be configuring Selenium to use Firefox.

2. To have Selenium recognize our Firefox browser, we must create a .exe file.

Download the Selenium server from the official website and install it. Make sure you download a version that's appropriate for your operating system.

The next step is to create a .exe file of Firefox so that Selenium can recognize your browser as Firefox. You'll have to visit this page and look for the appropriate download for your version of Firefox.

3. After saving your .exe file, run the command below to create it.

selenium -d browser=firefox-bin -probe-window --timeout=10 (Make sure to replace " FireFox_bin " with the name of your .exe file)

4. Now that our Firefox is recognized, we can start Selenium! We have included a script in the code below that will automatically start the Selenium server and automagically run our script every time Selenium runs. Please put this in a Windows shortcut and double-click it whenever you want to use Selenium for web scraping. It will launch your Firefox browser and detect its state as "active."

To automate the running of this script and open up the command prompt, we will use CMD in my examples below.

If you're already familiar with CMD, you can skip this step.

5. Open your Firefox browser now and run the command below at the prompt to see if you can see it with your keyboard.

c:\> Selenium --driver-binary firefox-bin:1.0/firefox-bin -probe-window --timeout=10 (Replace C:\ with wherever you saved your .exe file from the last step)

If you see nothing in your browser window, make sure that Selenium is running and try again. You can also try running the same command from PowerShell.

To open up PowerShell, hit the Start button on your desktop and search for it. If you're on a Mac, use Spotlight to find it.

6. Now that we know Selenium is working, let's test and see if Firefox is picking up our profile correctly by visiting UberEats.com and clicking on one of their links (you can follow the steps below or try out some of your own). Open up CMD again to start Selenium. c:\> selenium --driver-binary firefox-bin:1.0/firefox-bin -probe-window --timeout=10

7. In your browser, go to the Uber Eats website and find a restaurant on the homepage (I chose Red Lobster in this example). In the screenshot below, I'm clicking on a link that will take us to their homepage - open up CMD again.

8. After you're there, click one of their menu options to see how it looks in Selenium and try other restaurants or dishes! Try clicking the search bar and entering something before clicking on different links to ensure everything works correctly.

You should now be able to scrape Uber Eats and use the data in Excel.

Part 2: Scraping, Parsing, and Importing the Data into Excel with Beautiful Soup.

1. Cleaning up Uber Eats data. This first step will remove all of the junk HTML code in your browser and help get the data you scrape into an easier-to-read format. I've cleaned up the UberEats data by removing any ugly or hard-to-read HTML that Selenium left behind. Beautiful Soup can clean this up for us, but we'll have to do it manually by removing unnecessary tags.

Open a new excel spreadsheet and make sure cell A1 is empty. In this example, we use a Google Sheets template, which you can download from their website.

2. Copy and paste your HTML into cell A1. If you've followed my instructions, all web-scraped data will be in this cell.

3. Open up a new browser window and copy the snippet below into it (into a new tab). Make sure there is no error and that the script runs successfully. It will tell you if there's an issue with your script or if you didn't clean up your HTML well enough so that Selenium can understand it correctly for scraping.

4. After ensuring everything works correctly, click "View" in your original browser window and click "Page Source." It will display something like the below image with all of the junk HTML that we want to take out:

5. Select your browser's "Edit" menu (or Ctrl+E) and click on "Find in Page."

6. It will open a new window where you can enter your search terms. In this example, I searched for "open table." Finding a lot of results? You'll have to do a bit more cleaning up! Keep doing this until it only shows the results you want to scrape (including a table). Leave the search term blank after you're done and click "Find Next," then "Close" when finished.

7. We will save the scraped data in CSV format and quickly read it in Excel. Click the "File" menu in your original browser window to do this. Once you're there:

Click "Save As" (or Ctrl+S) to create a new file and save it as a CSV file. Open that new CSV file and ensure the content inside is similar to the image below: Now that we've cleaned up our data, let's look at how we can scrape it. This first step will remove all of the junk HTML code in your browser and help get the data you scrape into an easier-to-read format.


Web scraping can help us get valuable data from websites - and visualize it in an easy-to-read and convenient format. This article showed you how to scrape a website and then parse the data using Beautiful Soup in Microsoft Excel.

You should now be able to scrape UberEats.com and use the data in Excel. We hope this guide helped you learn something new! If you have any questions or if anything isn't working, please post them in the comments below. Thanks for reading!

Get in touch

We will catch you as early as we receive the message

We hate spam, and we respect your privacy.

What Our Clients Say About Foodspark

Over 1000+ Satisfied Clients and Still Growing

Read More Reviews

review review review