Web Scraper with Python

In this article, I’m going to create a web scraper with Python that pulls all the stories from Google News by extracting all the tags from the HTML of Google News.

Google News uses tags to create links to the various websites that make up the site. So in addition to some additional data, you’ll collect all the URLs of the articles that Google News displays. I will use the BeautifulSoup module to analyze the articles from Google News.

Also, Read – Machine Learning Full Course for free.

Parsing means taking a format like HTML and using a programming language to give it structure. For example, transforming data into an object. Now, to start this task of creating a web scraper with Python, you need to install a module named BeautifulSoup. It can be easily installed using the pip command; pip install beautifulsoup4.

Web Scraper with Python

Python has a built-in module, named urllib, for working with URLs. Add the following code to a new Python file:

import urllib.request from bs4 import BeautifulSoup class Scraper: def __init__(self, site): self.site = site

The __init__ method uses a website to extract as a parameter. Later you will pass “https://news.google.com/” as a parameter. The Scraper class has a method called scrape that you will call whenever you want to retrieve data from the site you passed.

Add the following code to your scrape method:

def scrape(self): r = urllib.request.urlopen(self.site) html = r.read()

The urlopen () function sends a request to a website and returns a Response object in which its HTML code is stored, along with additional data. The response of the function. read () returns the HTML of the Response object. All the HTML for the website is in the html variable.

You are now ready to analyze the HTML. Add a new line of code in the scrape function which creates a BeautifulSoup object, and pass the html variable and the “html.parser” string as a parameter:

def scrape(self): r = urllib.request.urlopen(self.site) html = r.read() parser = "html.parser" sp = BeautifulSoup(html,parser)

The BeautifulSoup object does all the hard work and parses the HTML. You can now add code to the scrape function that calls the find_all method on the BeautifulSoup object.

Pass “a” as the parameter and the method will return all the URLs the website is linked to in the HTML code you downloaded:

def scrape(self): r = urllib.request.urlopen(self.site) html = r.read() parser = "html.parser" sp = BeautifulSoup(html,parser) for tag in sp.find_all("a"): url = tag.get("href") if url is None: continue if "articles" in url: print("\n" + url)

The find_all method returns an iterable containing the tag objects found. Each time around the for loop, the variable receives the value of a new Tag object. Each Tag object has many different instance variables, but you just want the value of the href instance variable, which contains each URL.

You can get it by calling the get method and passing “href” as a parameter. Finally, you verify that the URL variable contains data; that it contains the string “articles” (you don’t want to print internal links); and if so, you print it. Here is the full web scraper:

import urllib.request from bs4 import BeautifulSoup class Scraper: def __init__(self, site): self.site = site def scrape(self): r = urllib.request.urlopen(self.site) html = r.read() parser = "html.parser" sp = BeautifulSoup(html,parser) for tag in sp.find_all("a"): url = tag.get("href") if url is None: continue if "articles" in url: print("\n" + url) news = "https://news.google.com/" Scraper(news).scrape()

When you run your program, the output should look like this:

./articles/CBMiiQFodHRwczovL3d3dy5tb25leWNvbnRyb2wuY29tL25ld3MvYnVzaW5lc3MvaXBvL2J1bXBlci1saXN0aW5nLWNoZW1jb24tc3BlY2lhbGl0eS1jaGVtaWNhbHMtZGVidXRzLWF0LXJzLTczMC05NS1hLTExNS1wcmVtaXVtLTU5MDc2MjEuaHRtbNIBjQFodHRwczovL3d3dy5tb25leWNvbnRyb2wuY29tL25ld3MvYnVzaW5lc3MvaXBvL2J1bXBlci1saXN0aW5nLWNoZW1jb24tc3BlY2lhbGl0eS1jaGVtaWNhbHMtZGVidXRzLWF0LXJzLTczMC05NS1hLTExNS1wcmVtaXVtLTU5MDc2MjEuaHRtbC9hbXA?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CBMiiQFodHRwczovL3d3dy5tb25leWNvbnRyb2wuY29tL25ld3MvYnVzaW5lc3MvaXBvL2J1bXBlci1saXN0aW5nLWNoZW1jb24tc3BlY2lhbGl0eS1jaGVtaWNhbHMtZGVidXRzLWF0LXJzLTczMC05NS1hLTExNS1wcmVtaXVtLTU5MDc2MjEuaHRtbNIBjQFodHRwczovL3d3dy5tb25leWNvbnRyb2wuY29tL25ld3MvYnVzaW5lc3MvaXBvL2J1bXBlci1saXN0aW5nLWNoZW1jb24tc3BlY2lhbGl0eS1jaGVtaWNhbHMtZGVidXRzLWF0LXJzLTczMC05NS1hLTExNS1wcmVtaXVtLTU5MDc2MjEuaHRtbC9hbXA?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CBMiiQFodHRwczovL3d3dy5tb25leWNvbnRyb2wuY29tL25ld3MvYnVzaW5lc3MvaXBvL2J1bXBlci1saXN0aW5nLWNoZW1jb24tc3BlY2lhbGl0eS1jaGVtaWNhbHMtZGVidXRzLWF0LXJzLTczMC05NS1hLTExNS1wcmVtaXVtLTU5MDc2MjEuaHRtbNIBjQFodHRwczovL3d3dy5tb25leWNvbnRyb2wuY29tL25ld3MvYnVzaW5lc3MvaXBvL2J1bXBlci1saXN0aW5nLWNoZW1jb24tc3BlY2lhbGl0eS1jaGVtaWNhbHMtZGVidXRzLWF0LXJzLTczMC05NS1hLTExNS1wcmVtaXVtLTU5MDc2MjEuaHRtbC9hbXA?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEN65JBQTlrAk1479WuKaQrAqFwgEKg4IACoGCAowxLQ_MNevCDDnvNMF?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEN65JBQTlrAk1479WuKaQrAqFwgEKg4IACoGCAowxLQ_MNevCDDnvNMF?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEIfG6g8TDa91LrUgvv4SfRcqGQgEKhAIACoHCAow2pqGCzD954MDMJzyigY?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEIfG6g8TDa91LrUgvv4SfRcqGQgEKhAIACoHCAow2pqGCzD954MDMJzyigY?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEG22Qtp4ab78Y5kFLRsWq-wqGQgEKhAIACoHCAow55veCjDzvdUBMIPh5gU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEG22Qtp4ab78Y5kFLRsWq-wqGQgEKhAIACoHCAow55veCjDzvdUBMIPh5gU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEEQDNi_6fessB82J6KVeq60qFggEKg4IACoGCAowxLQ_MNevCDCkoh8?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEEQDNi_6fessB82J6KVeq60qFggEKg4IACoGCAowxLQ_MNevCDCkoh8?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEKuQtxbx8j-uunfY5g-gOtoqFggEKg4IACoGCAoww7k_MMevCDDpywE?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEKuQtxbx8j-uunfY5g-gOtoqFggEKg4IACoGCAoww7k_MMevCDDpywE?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEKuQtxbx8j-uunfY5g-gOtoqFggEKg4IACoGCAoww7k_MMevCDDpywE?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CCAiC0o4TkNDS2JxVUhjmAEB?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CCAiC0o4TkNDS2JxVUhjmAEB?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEEGQxdSeKlwa2YvVLQyLUb8qFwgEKg4IACoGCAoww7k_MMevCDC6rdgG?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEEGQxdSeKlwa2YvVLQyLUb8qFwgEKg4IACoGCAoww7k_MMevCDC6rdgG?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEJM9pEXAVv1HEP1h6QlDxTIqGAgEKg8IACoHCAow3rvTBDD89X4w0bTmBQ?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEJM9pEXAVv1HEP1h6QlDxTIqGAgEKg8IACoHCAow3rvTBDD89X4w0bTmBQ?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEKG6ZOcOPT_OJQ6OLwGKe7sqGQgEKhAIACoHCAowzrL9CjDC7vQCMK2y1gU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEKG6ZOcOPT_OJQ6OLwGKe7sqGQgEKhAIACoHCAowzrL9CjDC7vQCMK2y1gU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEKG6ZOcOPT_OJQ6OLwGKe7sqGQgEKhAIACoHCAowzrL9CjDC7vQCMK2y1gU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEB_BeoliNbGwiNgLG9wZvAcqGQgEKhAIACoHCAowj8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JjLmNvbS9uZXdzL2FtcC9lbGVjdGlvbi11cy0yMDIwLTU0MzU5OTkz?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CBMiMmh0dHBzOi8vd3d3LmJiYy5jb20vbmV3cy9lbGVjdGlvbi11cy0yMDIwLTU0MzU5OTkz0gE2aHR0cHM6Ly93d3cuYmJjLmNvbS9uZXdzL2FtcC9lbGVjdGlvbi11cy0yMDIwLTU0MzU5OTkz?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEN6aa394GsWZUcUGXrA5c1MqFggEKg4IACoGCAowl6p7MN-zCTCOvRU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEN6aa394GsWZUcUGXrA5c1MqFggEKg4IACoGCAowl6p7MN-zCTCOvRU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEN0KfjKEcFiAFIUFjmbZyVsqFAgEKgwIACoFCAowhgIwkDgwob0I?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEN0KfjKEcFiAFIUFjmbZyVsqFAgEKgwIACoFCAowhgIwkDgwob0I?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEB13zqCd52y2AMSVeJKeC0cqFggEKg4IACoGCAowl6p7MN-zCTC9vBU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEB13zqCd52y2AMSVeJKeC0cqFggEKg4IACoGCAowl6p7MN-zCTC9vBU?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEMU5tjLhEKVlJN7lbLB1posqFwgEKg4IACoGCAowxLQ_MNevCDDnvNMF?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEMU5tjLhEKVlJN7lbLB1posqFwgEKg4IACoGCAowxLQ_MNevCDDnvNMF?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CBMisAFodHRwczovL3d3dy5uZXdzMTguY29tL25ld3MvaW5kaWEvY29yb25hdmlydXMtbGl2ZS11cGRhdGVzLW1vZGVyb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IACoGCAoww7k_MMevCDDpywE?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEDetFhO9fBaleLttbd22zb4qFggEKg4IACoGCAoww7k_MMevCDDpywE?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEDetFhO9fBaleLttbd22zb4qFggEKg4IACoGCAoww7k_MMevCDDpywE?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEHgy-jTL75PvW0YSpz73cJMqGQgEKhAIACoHCAowzrL9CjDC7vQCMM6a0wY?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEHgy-jTL75PvW0YSpz73cJMqGQgEKhAIACoHCAowzrL9CjDC7vQCMM6a0wY?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEDH5jNSiFxuFpjIB29xGfY0qGAgEKg8IACoHCAow3rvTBDD89X4w8YzmBQ?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEDH5jNSiFxuFpjIB29xGfY0qGAgEKg8IACoHCAow3rvTBDD89X4w8YzmBQ?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEPGK1AAXrmZY6jsLb1sTa_MqGQgEKhAIACoHCAowj8n_CjDIrfkCMILSxQY?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CAIiEPGK1AAXrmZY6jsLb1sTa_MqGQgEKhAIACoHCAowj8n_CjDIrfkCMILSxQY?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CBMiigFodHRwczovL2xpdmV1cGRhdGVzLmhpbmR1c3RhbnRpbWVzLmNvbS9pbmRpYS9jb3JvbmF2aXJ1cy1pbmRpYS13b3JsZC1sYXRlc3QtbmV3cy1jb3ZpZC0xOS1kZWF0aC10b2xsLXNlcHRlbWJlci0zMC0yMDIwLTIxNjAxNDI5OTE0MTM5Lmh0bWzSAY4BaHR0cHM6Ly9saXZldXBkYXRlcy5oaW5kdXN0YW50aW1lcy5jb20vaW5kaWEvY29yb25hdmlydXMtaW5kaWE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di10aGFja2VyYXkv0gEA?hl=en-IN&gl=IN&ceid=IN%3Aen

./articles/CBMibmh0dHBzOi8vZmFjdGx5LmluL29zZC10by1mb3JtZXItbWFoYXJhc2h0cmEtY20tZGV2ZW5kcmEtZmFkbmF2aXMtaXMtYmVpbmctcmVmZXJyZWQtYXMtb3NkLXRvLXVkZGhhdi10aGFja2VyYXkv0gEA?hl=en-IN&gl=IN&ceid=IN%3Aen

Process finished with exit code 0

Now with this web scraper with Python, you can collect Google News headlines, the possibilities are endless. You can write a program to analyze the most used words in headlines. You can create a program to analyze stock sentiment and see if it correlates with the stock market.

With this web scraper with Python, all the information in the world is yours, and I hope that turns you on as much as I do. Hope you liked this article on how to create a web scraper with Python. Please feel free to ask your valuable questions in the comments section below.

Also, Read – 6 Best Laptops for Machine Learning.

Follow Us:

Leave a Reply