Selenium Scripts are built to do some tedious tasks which can be automated using headless web browsers.
For example, Searching for some Questions on Different Search engines and storing results in a file by visiting each link. This task can take a long for a normal human being but with the help of selenium scripts one can easily do it
How to Use selenium with Python and Linux Environment.
Python should already be installed. It can be 2.* or 3.* version.
- Installing Selenium
- Installing Webdrivers (headless)
- Creating Simple Code
Whatever Operating System You are Using Python command is Same for Installing Selenium Library.
Open Terminal/Cmd and Write Command as written Below
python -m pip install selenium
Alternatively, you can download the source distribution here, unarchive it, and run the command below:
python setup.py install
One Can Install Firefox, Chromium, PhantomJs(Deprecated Now), etc.
- for using Firefox you may need to install GeckoDriver
- for using Chrome you may need to install Chromium
In this article, Firefox is used so One can Follow the Bellow Steps to Install:-
Steps for Linux:-
1. Go to the geckodriver releases page. Find the latest version of the driver for your platform and download it.
2. Extract the file with:
tar -xvzf geckodriver*
3. Make it executable:
chmod +x geckodriver
4. Move Files to usr/local/bin
sudo mv geckodriver /usr/local/bin/
Steps for Windows:-
1. Same as Step 1 in Linux Download the GeckoDriver
2. Extract it using WinRar or any application you may have.
3. Add it to Path using Command Prompt
setx path "%path%;GeckoDriver Path"
setx path "%path%;c:/user/eliote/Desktop/geckodriver-v0.26.0-win64/geckodriver.exe"
Creating Simple Code
- How to install Python on Linux?
- How to install Python on Windows?
- How to install Python Pycharm on Linux?
- How to install OpenCV for Python in Linux?
- How to install OpenCV for Python in Windows?
- How to install Python Pycharm on Windows?
- How to Install Python Tensorflow in Windows?
- How to install Librosa Library in Python
- Install Python package using Jupyter Notebook
- Guide to Install MongoDB with Python | Windows
- How to install MySQL connector package in Python?
- Download and Install Python 3 Latest Version
- How to Install Python Pandas on Windows and Linux?
- How to install requests in Python - For windows, linux, mac
- How to download and install Python Latest Version on Linux
- How to download and install Python Latest Version on macOS / Mac OS X
- How to download and install Python Latest Version on Android
- How to download and install Python Latest Version on Windows
- Python | SMS Bomber using Selenium
- Waits in Selenium Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.