Install Python:

If you are using a Linux machine then you have already installed Python, so only Windows users need to download and install Python. For this, go the following URL, download the latest Python (I am using 2.7.x) and install it:

https://www.python.org/downloads/

Install PIP:

If you already have Python installed in you system, then you have PIP but you need to update it.

To install pip, securely download get-pip.py.

Run the file, it will update PIP.

Make Python Executable via CMD:

Now to make python executable via windows command line, you need to add environment variable, For this go to My Computer Properties > Click Advanced System Settings > click Environment Variables.. > select PATH and click Edit.

Here, add “C:\Python27″ and “C:\Python27\Scripts” by clicking New. If any of them are already exist then no need to add again. Now press OK for everything.

2016-11-20_0-07-242016-11-20_0-08-302016-11-20_0-10-512016-11-20_0-11-152016-11-20_0-13-03

Now close and open the CMD. You can now able to run python files from command prompt by typing ‘python test.py’ where test.py is a python script.

Please Note: Sometimes the PC may need to logoff and then login again to take effect this new installation.

Install Selenium

For installing Selenium first,

Open the CMD.

go to python script directory by typing:

cd C:\Python27\Scripts

Now install Selenium:

pip install -U selenium

It will appear like bellow after successful completion:

2016-11-20_0-28-32

Install Chrome Driver:

To install Chrome driver you need to installed the Chrome browser in your system.

Now, download the latest chrome driver from the official page: https://sites.google.com/a/chromium.org/chromedriver/downloads

To download the latest Firefox (Gecko dirver) download the latest form here: http://www.seleniumhq.org/download/

Unzip it and copy the chromedriver.exe file to “C:\Python27” location.

Please Note: While updating any driver (Chromedriver, Firefox Gecko driver) you need to copy the latest driver.exe file to this same location and replace the old one with new one.

Advertisements