Selenium is a powerful tool for controlling the web browser through a program. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python, Java, C#, etc, we will be working with Python.
In this article, we are going to see how to automate the Caloriemama website using selenium. We are just going to post a food picture on
caloriemama API website and return the result it shows on that site.
Before going into code, we need to install selenium for Python.
pip install selenium
Selenium requires a web driver to interface with the chosen browser.Web drivers is a package to interact with web browser. It interacts with the web browser or a remote web server through a wire protocol which is common to all. You can check out and install the web drivers of your browser choice.
Chrome: https://sites.google.com/a/chromium.org/chromedriver/downloads Firefox: https://github.com/mozilla/geckodriver/releases Safari: https://webkit.org/blog/6900/webdriver-support-in-safari-10/
- selenium: For automating the web browser
- time: For using sleep function because selenium works only when the all the elements of the page is loaded.
We are going to send the picture of the food and get the recognized food result as text. Let’s consider the image of food looks like this –
- ML | Face Recognition Using PCA Implementation
- FaceNet - Using Facial Recognition System
- ML | Implement Face recognition using k-NN with scikit-learn
- Text Localization, Detection and Recognition using Pytesseract
- Python | Named Entity Recognition (NER) using spaCy
- Python | Multiple Face Recognition using dlib
- Human Activity Recognition - Using Deep Learning Model
- Python | Reading contents of PDF using OCR (Optical Character Recognition)
- Google Chrome Dino Bot using Image Recognition | Python
- Python | Speech recognition on large audio files
- Components of Selenium
- Automation Using Selenium in C# With Example
- Features of Selenium WebDriver
- Waits in Selenium Python
- How to take screenshot using Selenium in Python ?
- Exceptions - Selenium Python
- Applications and Uses of Selenium WebDriver
- Selenium Python Tutorial
- Limitations of Selenium Webdriver
- Selenium Python Basics
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.