Create a file named packages.txt
in the root directory of Gradio, and insert the following content:
chromium-driver
By doing this, you will ensure the installation of the Chromium driver for Debian.
create a a file named requirements.txt
in the root directory of Gradio, and insert the following content:
selenium >=4.0.0, < 5.0.0
By doing this, you will ensure the installation of selenium.
now you can in the app.py import selenium
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
I provided an example here, this space can get screenshot of the input url: https://huggingface.co/spaces/kargaranamir/selenium-screenshot-gradio