0% found this document useful (0 votes)
27 views10 pages

5th Module

Uploaded by

adnagaprasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views10 pages

5th Module

Uploaded by

adnagaprasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Module 5

Networked programs
HyperText Transfer Protocol - HTTP, The world’s simplest web browser, Retrieving
an image over HTTP, Retrieving web pages with urllib, Reading binary files using
urllib, Parsing HTML and scraping the web, Parsing HTML using regular expressions,
Parsing HTML using BeautifulSoup, Bonus section for Unix / Linux users.
Using Web Services
eXtensible Markup Language - XML, Parsing XML, Looping through nodes
,JavaScript Object
Notation - JSON, Parsing JSON, Application Programming Interfaces, Security and
API usage.
Using databases and SQL
What is a database?, Database concepts, Database Browser for SQLite, Creating a
database table, Structured Query Language summary , Spidering Twitter using a
database, Basic data modeling, Programming with multiple tables ,Three kinds of
keys ,Using JOIN to retrieve data.
NETWORKED PROGRAMS
• HyperText Transfer Protocol (HTTP)
• HTTP (HyperText Transfer Protocol) is the
media through which we can retrieve web-
based data.
The World’s Simplest Web Browser
• The built-in module socket of Python
facilitates the programmer to make network
connections and to retrieve data over those
sockets in a Python program.
• Socket is bidirectional data path to a remote
system.
• A socket is much like a file, except that a
single socket provides a two-way connection
between two programs.
Program to retrieve the data from a
web page.

Socket Programming
Socket programming is a way of connecting two nodes on a
network to communicate with each other.
nclude the socket module –
import socket

Syntax:
socket.socket(socket_family, socket_type, protocol=0)

Where,

•socket_family: Either AF_UNIX or AF_INET


•socket_type: Either SOCK_STREAM or SOCK_DGRAM.
•protocol: Usually left out, defaulting to 0.
Retrieving an image over HTTP

You might also like