How to perform web automation using Python? | Web Scraping using Selenium.

For performing web automation or web scraping using python:
  1. Install Selenium using pip command.
  2. Download browser driver.
  3. Write Python code using any IDE.

How to install Selenium using pip command?

Open command prompt and type pip install selenium and wait for a while to get it installed.
If you are using mac or linux, write pip3 instead of pip.

python web automation framework  python web scraping  python selenium  python script to open webpage and login  python interact with website  python selenium chrome  selenium python web scraping  automate web form filling python


How to Download browser driver?

Download browser driver from the internet. Here in my case, I am using driver for Google Chrome. However, you can use other browser also.
I am suing Google Chrome 86 version, so i am selecting second option.


I am selecting chromedriver_win32.zip, since i am using windows.
selenium chromedriver python  install chromedriver ubuntu  install chromedriver python  selenium webdriver download  update selenium-chromedriver  chromedriver selenium mac  how to check chromedriver version  install chromedriver mac

Extract the driver and place it in the c->proramme File folder for easy access. However, you can place it anywhere in your computer. Copy this path.

Write the following python code in an IDE. I am using Visual Editor.


 from selenium import webdriver
PATH="C:\Program Files\chromedriver.exe"
driver=webdriver.Chrome(PATH)
driver.get("https:www.phdtalks.org")
driver.close() # for quitting the current tab of a browser.
driver.quit() # for quiting the Browser.
print(driver.title) # for printing the title of a web page.

Comments

Popular posts from this blog

Accounting Multiple Choice Questions with answers | Download PDF for MCQs

Accounting multiple choice questions with answers | Download pdf of MCQs