SlideShare a Scribd company logo
WebProgramming
Learning Objectives
By the end of this lesson, you will be able to:
Demonstrate Web Scraping
Demonstrate Web Frameworks
Explain Django
Web Scraping
Web Scraping
Web Scraping is a process of extracting information from a website or internet. Web scraping is one of
the most important techniques of data extraction from internet. It allows the extraction of unstructured
data from websites and convert it into structured data.
BASIC STEPS FOR WEB SCRAPING
Select
website
Authenticate
Generate
request
Process
Information
Web Scraping Applications
Web Scraping plays a major role in data extraction that helps in business Improvements. At present, a
website to any business is mandatory. This explains the importance of web scraping in information
extraction
Let’s see some of the applications of web scraping.
Data
Scienc
e
E-
Commerce
Sales
Finance
Web
Scrapping
Applications
Marketing
Different Methods of Web Scraping
There are different methods to extract information from websites. Authentication is an important aspect
for web scraping and every website has some restrictions for their content extraction.
Web scraping focuses on extracting data such as product costs, weather data, pollution check, criminal
data, stock price movements etc,. in our local database for analysis.
Copying
API
Keys
Socket
Programming
Web Scraping in Python
Python is one of the favorite languages for web scraping. Web scraping can be used for data analysis
when we have to analyze information from a website
The important libraries in Python that assists us in web scraping are:
Allows to scrape information from website in simple
steps.
Beautiful
Soup
Web scraping and automation
tool
Mechanize
Beautiful Soup Installation Steps
Execute conda install –c anaconda beautifulsoup4 in anaconda prompt
or
Execute pip install beautifulsoup4 in command prompt
Installation
starts
here
Demo: Web Scraping Using Beautiful Soup
Demo: Web Scraping Using Beautiful Soup
Demo: Web Scraping Using Beautiful Soup
Demo: Web Scraping Using Beautiful Soup
Do it yourself: Web Scraping Using Beautiful Soup
pip install beautifulsoup4
from urllib.request import urlopen
from bs4 import BeautifulSoup
url="https://timesofindia.com"
html=urlopen(url)
s=BeautifulSoup(html, 'lxml')
type(s)
title=s.title
title
text=s.get_text()
s.text
s.find_all('a')
links=s.find_all('a')
for link in links:
print(link.get("href"))
Django Framework
Django
Django is a high-level, popular Python framework for web development. Access to Django is
free & open source. Django is open-source and web apps can be created with less code. As a
framework, it is used for backend and front-end web development.
Fast Secure Scalable
Companies Using Django
Disqus
Instagram
YouTube
Bitbucket
Mozilla
Spotify
Important Attributes of Django
• A web browser is an interface for URL.
• A URL is the web address and the act of assigning functions to url is called
mapping.
• Django template is simply a text document or a Python string marked-
up using the Django template language. All the html files are stored in
templates.
• Static folder is used to store other CSS files, java files , images etc.
• Functions related to web apps are written inside view. It also renders
content to templates, puts information into model and gets information
from databases.
Important Attributes of Django
• Form fetches data from HTML form and helps connect to the model.
• Model is information about the object structure stored in a database. It
contains essential fields and data behavior. Information can be directly
edited in the database.
• Django automatically looks for an admin module in each application and
imports it. Registration of object in model is done through admin, which is
the mandatory first step for database management.
• Database is the collection of data at backend.
Technical Architecture
This is the technical architecture followed in Django:
Django Installation Steps
Write conda install -c anaconda django in anaconda prompt.
Knowledge Check
Which of the following is a web scraping library in
Python?
a. Beautiful Soup
b. Pandas
c. Numpy
d. None of the above
Knowledge
Check
1
Which of the following is a web scraping library in Python?
a. Beautiful Soup
b. Pandas
c. Numpy
d. None of the above
Knowledge
Check
1
The correct answer is a
Beautiful Soup is for web scraping, Pandas for data analysis, and Numpy for numerical
analysis.
Knowledge
Check
2
Data extraction is the most important aspect of web scraping.
a. False
b. True
Knowledge
Check
2
Data extraction is the most important aspect of web
scraping.
The correct answer is b
Web scraping means extracting information from a URL. So, data extraction is the most important aspect of
web scraping.
a. False
b. True
In Python, a=BeautifulSoup() is an expression, where a/an is
a. A constructor
b. An object
c. A class
d. A value returning function
Knowledge
Check
3
In Python, a=BeautifulSoup() is an expression, where a/an is
a. A constructor
b. An object
c. A class
d. A value returning function
Knowledge
Check
3
The correct answer is b
a is an object created using
BeautifulSoup().
What is the role of render_to_response method in Django?
a. Generating web response
b. Rendering data from
web
c. Rendering an HTML response
d. None of above
Knowledge
Check
4
What is the role of render_to_response method in Django?
a. Generating web response
b. Rendering data from
web
c. Rendering an HTML response
d. None of above
Knowledge
Check
4
The correct answer is c
In Django, render_to_response method is used to easily render an HTML
response.
Key Takeaways
Web scraping is a method of extracting information from a
URL.
Beautiful Soup is one of the simplest and most useful web
scraping libraries in Python.
Django is a high-level web framework used for web
development in Python.

More Related Content

PPTX
Web Scrapping Using Python
ODP
Web Development in Django
PPTX
Django Girls Tutorial
PPTX
Django Framework Overview forNon-Python Developers
PDF
django
DOCX
Akash rajguru project report sem v
PDF
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
PDF
Learn Django Tips, Tricks & Techniques for Developers
Web Scrapping Using Python
Web Development in Django
Django Girls Tutorial
Django Framework Overview forNon-Python Developers
django
Akash rajguru project report sem v
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
Learn Django Tips, Tricks & Techniques for Developers

Similar to Web programming using python frameworks. (20)

KEY
Intro To Django
PDF
Progressive Web App Challenges
PDF
Offline of web applications
PDF
Offline for web - Frontend Dev Conf Minsk 2014
PDF
Introduction to Django
PPT
Introduction To Django
PPTX
Ramya devi R internet of things
PPT
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
ODP
Introduction To Django
PDF
A Gentle introduction to Web Development & Django
PPTX
Data-Analytics using python (Module 4).pptx
PDF
Python Django Webnet Computer Institute.pdf
DOCX
Company Visitor Management System Report.docx
PDF
Top 13 web scraping tools in 2022
PDF
Lightweight Django 1st Edition Julia Elman
PPTX
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
PDF
C3 2012 Inside the Searchlight API - Dan Cristo
PDF
James Jara Portfolio 2014 Part 1
ODP
Portafolio
PDF
Getting Started With Django
Intro To Django
Progressive Web App Challenges
Offline of web applications
Offline for web - Frontend Dev Conf Minsk 2014
Introduction to Django
Introduction To Django
Ramya devi R internet of things
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
Introduction To Django
A Gentle introduction to Web Development & Django
Data-Analytics using python (Module 4).pptx
Python Django Webnet Computer Institute.pdf
Company Visitor Management System Report.docx
Top 13 web scraping tools in 2022
Lightweight Django 1st Edition Julia Elman
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
C3 2012 Inside the Searchlight API - Dan Cristo
James Jara Portfolio 2014 Part 1
Portafolio
Getting Started With Django
Ad

More from Puneet Kumar Bhatia (MBA, ITIL V3 Certified) (20)

PPTX
Python Conditional_Statements_and_Functions
PPTX
Azure Fubdamentals (Az-900) presentation.
PPTX
Azure - Basic concepts and overview.pptx
PPTX
Cloud Computing basics - an overview.pptx
PPTX
Ansible as configuration management tool for devops
PPTX
Microsoft Azure - Basic concepts presentation
PPTX
Introduction to the Nexus tool for DevOps
PPTX
Introduction to Monitoring Tools for DevOps
PPTX
Introduction to Monitoring Tools for DevOps
PPT
Introduction to Devops and its applications
PPTX
Container Orchestration using kubernetes
PPTX
Containerization using docker and its applications
PPTX
Containerization using docker and its applications
PDF
Java Microservices_64 Hours_Day wise plan (002).pdf
PDF
Java Microservices_64 Hours_Day wise plan (002).pdf
PPTX
Changing paradigm in job market
PDF
Python Conditional_Statements_and_Functions
Azure Fubdamentals (Az-900) presentation.
Azure - Basic concepts and overview.pptx
Cloud Computing basics - an overview.pptx
Ansible as configuration management tool for devops
Microsoft Azure - Basic concepts presentation
Introduction to the Nexus tool for DevOps
Introduction to Monitoring Tools for DevOps
Introduction to Monitoring Tools for DevOps
Introduction to Devops and its applications
Container Orchestration using kubernetes
Containerization using docker and its applications
Containerization using docker and its applications
Java Microservices_64 Hours_Day wise plan (002).pdf
Java Microservices_64 Hours_Day wise plan (002).pdf
Changing paradigm in job market
Ad

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
medical staffing services at VALiNTRY
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
PPTX
FLIGHT TICKET RESERVATION SYSTEM | FLIGHT BOOKING ENGINE API
PPTX
Mastering-Cybersecurity-The-Crucial-Role-of-Antivirus-Support-Services.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
AI in Product Development-omnex systems
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
PPT
Introduction Database Management System for Course Database
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
PDF
System and Network Administration Chapter 2
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
ai tools demonstartion for schools and inter college
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
VVF-Customer-Presentation2025-Ver1.9.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
medical staffing services at VALiNTRY
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
FLIGHT TICKET RESERVATION SYSTEM | FLIGHT BOOKING ENGINE API
Mastering-Cybersecurity-The-Crucial-Role-of-Antivirus-Support-Services.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
AI in Product Development-omnex systems
The Role of Automation and AI in EHS Management for Data Centers.pdf
Introduction Database Management System for Course Database
The Five Best AI Cover Tools in 2025.docx
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
System and Network Administration Chapter 2
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
ai tools demonstartion for schools and inter college
Odoo POS Development Services by CandidRoot Solutions
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
How to Migrate SBCGlobal Email to Yahoo Easily
Materi_Pemrograman_Komputer-Looping.pptx
How to Choose the Right IT Partner for Your Business in Malaysia

Web programming using python frameworks.

  • 2. Learning Objectives By the end of this lesson, you will be able to: Demonstrate Web Scraping Demonstrate Web Frameworks Explain Django
  • 4. Web Scraping Web Scraping is a process of extracting information from a website or internet. Web scraping is one of the most important techniques of data extraction from internet. It allows the extraction of unstructured data from websites and convert it into structured data. BASIC STEPS FOR WEB SCRAPING Select website Authenticate Generate request Process Information
  • 5. Web Scraping Applications Web Scraping plays a major role in data extraction that helps in business Improvements. At present, a website to any business is mandatory. This explains the importance of web scraping in information extraction Let’s see some of the applications of web scraping. Data Scienc e E- Commerce Sales Finance Web Scrapping Applications Marketing
  • 6. Different Methods of Web Scraping There are different methods to extract information from websites. Authentication is an important aspect for web scraping and every website has some restrictions for their content extraction. Web scraping focuses on extracting data such as product costs, weather data, pollution check, criminal data, stock price movements etc,. in our local database for analysis. Copying API Keys Socket Programming
  • 7. Web Scraping in Python Python is one of the favorite languages for web scraping. Web scraping can be used for data analysis when we have to analyze information from a website The important libraries in Python that assists us in web scraping are: Allows to scrape information from website in simple steps. Beautiful Soup Web scraping and automation tool Mechanize
  • 8. Beautiful Soup Installation Steps Execute conda install –c anaconda beautifulsoup4 in anaconda prompt or Execute pip install beautifulsoup4 in command prompt Installation starts here
  • 9. Demo: Web Scraping Using Beautiful Soup
  • 10. Demo: Web Scraping Using Beautiful Soup
  • 11. Demo: Web Scraping Using Beautiful Soup
  • 12. Demo: Web Scraping Using Beautiful Soup
  • 13. Do it yourself: Web Scraping Using Beautiful Soup pip install beautifulsoup4 from urllib.request import urlopen from bs4 import BeautifulSoup url="https://timesofindia.com" html=urlopen(url) s=BeautifulSoup(html, 'lxml') type(s) title=s.title title text=s.get_text() s.text s.find_all('a') links=s.find_all('a') for link in links: print(link.get("href"))
  • 15. Django Django is a high-level, popular Python framework for web development. Access to Django is free & open source. Django is open-source and web apps can be created with less code. As a framework, it is used for backend and front-end web development. Fast Secure Scalable
  • 17. Important Attributes of Django • A web browser is an interface for URL. • A URL is the web address and the act of assigning functions to url is called mapping. • Django template is simply a text document or a Python string marked- up using the Django template language. All the html files are stored in templates. • Static folder is used to store other CSS files, java files , images etc. • Functions related to web apps are written inside view. It also renders content to templates, puts information into model and gets information from databases.
  • 18. Important Attributes of Django • Form fetches data from HTML form and helps connect to the model. • Model is information about the object structure stored in a database. It contains essential fields and data behavior. Information can be directly edited in the database. • Django automatically looks for an admin module in each application and imports it. Registration of object in model is done through admin, which is the mandatory first step for database management. • Database is the collection of data at backend.
  • 19. Technical Architecture This is the technical architecture followed in Django:
  • 20. Django Installation Steps Write conda install -c anaconda django in anaconda prompt.
  • 22. Which of the following is a web scraping library in Python? a. Beautiful Soup b. Pandas c. Numpy d. None of the above Knowledge Check 1
  • 23. Which of the following is a web scraping library in Python? a. Beautiful Soup b. Pandas c. Numpy d. None of the above Knowledge Check 1 The correct answer is a Beautiful Soup is for web scraping, Pandas for data analysis, and Numpy for numerical analysis.
  • 24. Knowledge Check 2 Data extraction is the most important aspect of web scraping. a. False b. True
  • 25. Knowledge Check 2 Data extraction is the most important aspect of web scraping. The correct answer is b Web scraping means extracting information from a URL. So, data extraction is the most important aspect of web scraping. a. False b. True
  • 26. In Python, a=BeautifulSoup() is an expression, where a/an is a. A constructor b. An object c. A class d. A value returning function Knowledge Check 3
  • 27. In Python, a=BeautifulSoup() is an expression, where a/an is a. A constructor b. An object c. A class d. A value returning function Knowledge Check 3 The correct answer is b a is an object created using BeautifulSoup().
  • 28. What is the role of render_to_response method in Django? a. Generating web response b. Rendering data from web c. Rendering an HTML response d. None of above Knowledge Check 4
  • 29. What is the role of render_to_response method in Django? a. Generating web response b. Rendering data from web c. Rendering an HTML response d. None of above Knowledge Check 4 The correct answer is c In Django, render_to_response method is used to easily render an HTML response.
  • 30. Key Takeaways Web scraping is a method of extracting information from a URL. Beautiful Soup is one of the simplest and most useful web scraping libraries in Python. Django is a high-level web framework used for web development in Python.