Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Find element with class name in requests-html 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 element with class name 'embedded-video'
video_frame= page_html.find('.embedded-video')
# get all atributes
video_attrs = video_frame[0].attrs
# find the url using dict.get()
video_url = video_attrs['src']
# printing element
print(video_url)Copy Code
Comment

PREVIOUS NEXT
Code Example
Python :: Find meta tag of a website in python 
Python :: find not in dafatrame series 
Python :: jupyterlab collapsing cells 
Python :: Broadcasting with NumPy Arrays Plotting a two-dimensional function Example 
Python :: Python NumPy atleast_1d Function Example 02 
Python :: Python NumPy ndarray flat function Example 
Python :: os.path.join not working 
Python :: python f strings 
Python :: how to import scypy in python 
Python :: Python NumPy asmatrix Function Example 
Python :: Python NumPy stack Function Syntax 
Python :: First CGI program 
Python :: Python NumPy delete Function Example Deletion performed using Boolean Mask 
Python :: mid point line drawing 
Python :: Python __div__ magic method 
Python :: NumPy rot90 Syntax 
Python :: python multiply function with return keyword 
Python :: NumPy unpackbits Syntax 
Python :: python code to scan paper table to excel 
Python :: geopandas cmap change options 
Python :: Remove Brackets from List Using join method 
Python :: python to dart converter 
Python :: list[:] 
Python :: browser environment: 
Python :: load SQLite db into memory 
Python :: How to correctly call url_for and specify path parameters 
Python :: imprimir variables en python 
Python :: discord.py main file setup 
Python :: how to enter tavble in sal through sql 
Python :: Lambda expressions using f-string 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =