Answers for "grab element based on text from html page in python"

0

grab element based on text from html page 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://webscraper.io/'
# making get request to the webpage
respone = session.get(web_page)
# getting the html of the page
page_html = respone.html
# finding elements based on text
p_tag_with_text= page_html.find('p',containing='web data extraction')
# printing the element
print(p_tag_with_text)
 Copy Code
Posted by: Guest on April-21-2022

Code answers related to "grab element based on text from html page in python"

Python Answers by Framework

Browse Popular Code Answers by Language