Advertisement
skip420

WebHeader

Sep 18th, 2021
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # we can grab the website header using this
  2. # importing the modules
  3. import requests
  4. from bs4 import BeautifulSoup
  5.  
  6. # target url
  7. url = 'https://insaneseeds.com'
  8.  
  9. # making requests instance
  10. reqs = requests.get(url)
  11.  
  12. # using the BeaitifulSoup module
  13. soup = BeautifulSoup(reqs.text, 'html.parser')
  14.  
  15. # displaying the title
  16. print("Title of the website is : ")
  17. for title in soup.find_all('title'):
  18.     print(title.get_text())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement