Web Scraping in Python

Published: 16 March 2020
on channel: linuxhint
680
17

In this video, we have explained web scrapping that what web scrapping is and how we can do web scrapping using python. Web scraping is an automated way to extract and process information from internet websites in a very large amount. Data on the internet websites is not structured, which can be collected and structured through web scraping. Python is widely used for the web scrapping because it is very easy to setup and use. Python has simple syntax and built in third party libraries. We have explained the build in libraries of python that are used in web scrapping and demonstrated their installation procedure on linux. Moreover, we have demonstrated the python web scrapping with examples.
Commands used in this video for installing libraries
pip install requests
pip install html5lib
pip install bs4
pip install urllib3
Following is the code that is used in this video for demonstration
Example 1
import requests
URL = "https://linuxhint.com/"
r = requests.get(URL)
print(r.content)
Example 2
import requests
from bs4 import BeautifulSoup
URL= “https://www.fluentu.com/blog/business...
r = requests.get(URL)
soup=BeautifulSoup(r.content, ‘html5lib’)
print(soup.prettify())
Example 3
import urllib3
from bs4 import BeautifulSoup
http = urllib3.PoolManager()
r = http.request('GET', 'https://linuxhint.com')
soup = BeautifulSoup(r.data, 'html5lib')
print (soup.title)
print (soup.title.text)


#webscraping #python


On this page of the site you can watch the video online Web Scraping in Python with a duration of hours minute second in good quality, which was uploaded by the user linuxhint 16 March 2020, share the link with friends and acquaintances, this video has already been watched 680 times on youtube and it was liked by 17 viewers. Enjoy your viewing!