Answers for "Find meta tag of a website in python"

0

Find meta tag of a website in python

# importing the HTMLSession class
from requests_html import HTMLSession
# create the object of the session
session = HTMLSession()
# url of the page
web_page = 'https://totalhealthmagazine.com/About-Us'
# making get request to the webpage
respone = session.get(web_page)
# getting the html of the page
page_html = respone.html
# finding all meta tags
meta_tags= page_html.find('meta')
# extracting meta tags html
for tag in meta_tags:
    print(tag.html)Copy Again
Posted by: Guest on April-21-2022

Python Answers by Framework

Browse Popular Code Answers by Language