Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: Explaining async session in requests-html 
Python :: list expression inside bracket python 
Python :: Python NumPy squeeze function Example with axis 
Python :: Python NumPy atleast_3d Function Example 
Python :: Python NumPy transpose Function Example in one line of code 
Python :: Python NumPy ravel function example Showing ordering manipulation 
Python :: python antigravity 
Python :: python read file with class 
Python :: kaggle replace 
Python :: Python NumPy asfortranarray Function Syntax 
Python :: Python NumPy block Function Example by using np.eye function 
Python :: how to kill python program 
Python :: How can I Duplicate 1 Dimensional array 
Python :: (ax=self.canv.axes ,style="ro--") 
Python :: __truediv__ 
Python :: NumPy rot90 Example Rotating Twice 
Python :: beaglebone install python 3.7 
Python :: NumPy unpackbits Code Unpacked array along axis 0 
Python :: http://172.18.0.128:8114/ 
Python :: if not isinstance multiple values 
Python :: Remove Brackets from List Using for loop 
Python :: knn compute_distances_two_loop 
Python :: pandas dataframe select columns multiple cell value 
Python :: operasi tipe data integer 
Python :: gitlab ci deploy key 
Python :: how to seperate the script from html template when using jQuery in flask 
Python :: edgar python documentation 
Python :: get the first principle component of pca 
Python :: update specific field in index in elastic using python 
Python :: python dict setdefault list 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =