Created
February 28, 2019 10:56
-
-
Save ash17791/94c55476beb217404c1c4366ce1eb15a to your computer and use it in GitHub Desktop.
Write a Python program to extract h1 tag from example.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
url = requests.get('http://www.example.com/') | |
soup = BeautifulSoup(url.text, 'html.parser') | |
story1 = soup.find_all('h1') | |
for i in story1: | |
print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment