Web scraping with Python – A beginner’s guide

Have you ever heard of web scraping? It is is an automated technique that is used to extract large amounts of data from websites. If you are interested in getting started with web scraping, then this tutorial is for you!

Have you ever heard of web scraping? It is is an automated technique that is used to extract large amounts of data from websites. If you are interested in getting started with web scraping, then this tutorial is for you!

Imagine you have to pull out a huge amount of data from a particular website. Is it possible to do so, without manually going to each webpage and getting the data? Well yes, it is definitely possible using a technique called “Web Scraping”.

Web Scraping is an automated technique that is used to extract large amounts of data from websites whereby the data is extracted and saved to a local file in your computer. Web Scraping is becoming increasingly popular since the data extracted from the web can serve a lot of different purposes like:

  • Price Comparison: Web Scraping can be used to track product and service prices in different markets over time.
  • Social Media Scraping: Data from Social Media websites like Twitter can be collected by Web Scraping and used to find out what’s trending.
  • Research and Development: Web Scraping is used to collect large data sets like statistics, temperature, etc. from different websites, which are then used to carry out surveys.
  • Recruitment Web Scraping: Data from career-focused websites can be extracted by Web Scraping, in order to find the right people for certain job vacancies.
  • Extraction of Contact Information: Web Scraping can be used to scrape contact information such as emails, URLs, and phone numbers from websites.

Web Scraping has a lot of applications but implementing it can be slightly intimidating, so in this article, I will break down the process in elaborate steps to help you understand it better.

But before we get into that, here are some important points-to-remember about Web Scraping:

  1. Always read through the website’s Terms and Conditions to understand how you can legally use its data since most of the websites prohibit you from using the data for commercial purposes.
  2. Make sure you are not downloading the data at a rapid rate because this might break the website.
So, how does Web Scraping work?

To extract data using Web Scraping with Python, you need to follow the below steps:

  • Find the URL you want to scrape
  • Inspect the Page
  • Find the data you need to extract
  • Write the code
  • Run the code and extract the required data
  • Store the data in a specific format

Now, let us implement these steps in an example and see how to extract data from the Flipkart website using Python

Here are some libraries used for Web Scraping:

  • Selenium: A web testing library used to automate browser activities.
  • BeautifulSoup: It is a Python package for parsing HTML and XML documents. It creates parse trees that are helpful for extracting data easily.
  • Pandas: Pandas is a library used for data analysis and data manipulation. It is specifically used to extract data and store it in the desired format.

Now, let’s get started with the demonstration.

Scraping the Flipkart Website

Pre-requisites: Python 2.x or Python 3.x with Selenium, BeautifulSoup, pandas libraries installed; Google-chrome browser; Ubuntu Operating System

Step 1: Find the URL you want to scrape

We are going scrape the Flipkart website to extract the data for Price, Name, and Rating of Laptops. URL (find more information here).

Step 2: Inspect the Page

The data on the website is nested in tags. So, we need to inspect the page to see under which tag the data we want to scrape is nested. To inspect, just right click on the element and click on “Inspect”.

When you click on “Inspect”, a “Browser Inspector Box” will open on your screen.

Step 3: Find the data you need to extract

For this example, let us extract the Price, Name, and Rating which is nested in the “div” tag.

Step 4: Write the code

First, create a Python file. For this, open a terminal in Ubuntu and type gedit <your file name> with .py extension.

Let the file name is “web-s”. Now, here is the command:

gedit web-s.py

Now, let’s write our code in this file.

Before that, you need to import all the necessary libraries:




from selenium import webdriver

from BeautifulSoup import BeautifulSoup

import pandas as pd

We have to set the path to chromedriver, in order to configure webdriver to use Chrome browser

driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")

Refer the below code to open the URL:





products=[] #List to store name of the product

prices=[] #List to store price of the product

ratings=[] #List to store rating of the product


Now that we have written the code to open the URL, let’s extract the data from the website. As mentioned earlier, the data we want to extract is nested in tags. So, we have to find the <div> tags with those respective class-names, extract the data and store it in a variable. Refer to the code below:










content = driver.page_source

soup = BeautifulSoup(content)

for a in soup.findAll('a',href=True, attrs={'class':'_31qSD5'}):

name=a.find('div', attrs={'class':'_3wU53n'})

price=a.find('div', attrs={'class':'_1vC4OE _2rQ-NK'})

rating=a.find('div', attrs={'class':'hGSR34 _2beYZw'})




Step 5: Run the code to extract the data

Use the below command to run the code:

Python web-s.py

Step 6: Store the data in the desired format

After extracting the data, you might want to store it in the desired format. For this example, we will store it in a CSV (Comma Separated Value) format. To do this, add the following lines to your code:



df = pd.DataFrame({'Product Name':products,'Price':prices,'Rating':ratings})

df.to_csv('products.csv', index=False, encoding='utf-8')

Now, run the whole code again and you will get a file named “products.csv” which will contain your extracted data.

Python really makes the Web Scraping easy because of its easily understandable syntax and a large collection of Libraries.

I hope this article was informative and helped you guys get familiar with the concept of Web Scraping using Python. Now, you can go ahead and try Web Scraping by experimenting with different modules and applications of Python. If you don’t already know this language, why not learn Python this year?

Python GUI Programming Projects using Tkinter and Python 3

Python GUI Programming Projects using Tkinter and Python 3

Python GUI Programming Projects using Tkinter and Python 3

Learn Hands-On Python Programming By Creating Projects, GUIs and Graphics

Python is a dynamic modern object -oriented programming language
It is easy to learn and can be used to do a lot of things both big and small
Python is what is referred to as a high level language
Python is used in the industry for things like embedded software, web development, desktop applications, and even mobile apps!
SQL-Lite allows your applications to become even more powerful by storing, retrieving, and filtering through large data sets easily
If you want to learn to code, Python GUIs are the best way to start!

I designed this programming course to be easily understood by absolute beginners and young people. We start with basic Python programming concepts. Reinforce the same by developing Project and GUIs.

Why Python?

The Python coding language integrates well with other platforms – and runs on virtually all modern devices. If you’re new to coding, you can easily learn the basics in this fast and powerful coding environment. If you have experience with other computer languages, you’ll find Python simple and straightforward. This OSI-approved open-source language allows free use and distribution – even commercial distribution.

When and how do I start a career as a Python programmer?

In an independent third party survey, it has been revealed that the Python programming language is currently the most popular language for data scientists worldwide. This claim is substantiated by the Institute of Electrical and Electronic Engineers, which tracks programming languages by popularity. According to them, Python is the second most popular programming language this year for development on the web after Java.

Python Job Profiles
Software Engineer
Research Analyst
Data Analyst
Data Scientist
Software Developer
Python Salary

The median total pay for Python jobs in California, United States is $74,410, for a professional with one year of experience
Below are graphs depicting average Python salary by city
The first chart depicts average salary for a Python professional with one year of experience and the second chart depicts the average salaries by years of experience
Who Uses Python?

This course gives you a solid set of skills in one of today’s top programming languages. Today’s biggest companies (and smartest startups) use Python, including Google, Facebook, Instagram, Amazon, IBM, and NASA. Python is increasingly being used for scientific computations and data analysis
Take this course today and learn the skills you need to rub shoulders with today’s tech industry giants. Have fun, create and control intriguing and interactive Python GUIs, and enjoy a bright future! Best of Luck
Who is the target audience?

Anyone who wants to learn to code
For Complete Programming Beginners
For People New to Python
This course was designed for students with little to no programming experience
People interested in building Projects
Anyone looking to start with Python GUI development
Basic knowledge
Access to a computer
Download Python (FREE)
Should have an interest in programming
Interest in learning Python programming
Install Python 3.6 on your computer
What will you learn
Build Python Graphical User Interfaces(GUI) with Tkinter
Be able to use the in-built Python modules for their own projects
Use programming fundamentals to build a calculator
Use advanced Python concepts to code
Build Your GUI in Python programming
Use programming fundamentals to build a Project
Signup Login & Registration Programs
Job Interview Preparation Questions
& Much More

Guide to Python Programming Language

Guide to Python Programming Language

Guide to Python Programming Language

The course will lead you from beginning level to advance in Python Programming Language. You do not need any prior knowledge on Python or any programming language or even programming to join the course and become an expert on the topic.

The course is begin continuously developing by adding lectures regularly.

Please see the Promo and free sample video to get to know more.

Hope you will enjoy it.

Basic knowledge
An Enthusiast Mind
A Computer
Basic Knowledge To Use Computer
Internet Connection
What will you learn
Will Be Expert On Python Programming Language
Build Application On Python Programming Language

Python Programming Tutorials For Beginners

Python Programming Tutorials For Beginners

Python Programming Tutorials For Beginners

Hello and welcome to brand new series of wiredwiki. In this series i will teach you guys all you need to know about python. This series is designed for beginners but that doesn't means that i will not talk about the advanced stuff as well.

As you may all know by now that my approach of teaching is very simple and straightforward.In this series i will be talking about the all the things you need to know to jump start you python programming skills. This series is designed for noobs who are totally new to programming, so if you don't know any thing about

programming than this is the way to go guys Here is the links to all the videos that i will upload in this whole series.

In this video i will talk about all the basic introduction you need to know about python, which python version to choose, how to install python, how to get around with the interface, how to code your first program. Than we will talk about operators, expressions, numbers, strings, boo leans, lists, dictionaries, tuples and than inputs in python. With

Lots of exercises and more fun stuff, let's get started.

Download free Exercise files.

Dropbox: https://bit.ly/2AW7FYF

Who is the target audience?

First time Python programmers
Students and Teachers
IT pros who want to learn to code
Aspiring data scientists who want to add Python to their tool arsenal
Basic knowledge
Students should be comfortable working in the PC or Mac operating system
What will you learn
know basic programming concept and skill
build 6 text-based application using python
be able to learn other programming languages
be able to build sophisticated system using python in the future

To know more: