how can i extract this value from a website, with python, selenium and chromedriver

GB3
<div class="flexible row ng-scope">
    <!-- ngRepeat: graph in graphs track by $index --><figure class="figure-gauge flexible column ng-scope" data-ng-repeat="graph in graphs track by $index">
        <figcaption class="rigid">
            <div class="data-value">
                <b class="ng-binding">
                    334
                </b>
            </div>

I need to extract the value (334) that appears, i take this from Chrome Web Inspector . I am using python and selenium, I have tried with many codes but none has worked for me, I appreciate any help.

I try whit this:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

DRIVER_PATH = r'C:\chromedriver.exe'
options = Options()
options.headless = True
options.add_argument("--window-size=1920,1200")

driver = webdriver.Chrome(options=options, executable_path=DRIVER_PATH)
driver.get("https://iot.app.initialstate.com/embed/#/tiles/bkt_kb448kawjvmhe")
data = driver.find_element_by_class_name('ng-binding')
print
driver.quit()

Error: selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".ng-binding"} (Session info: headless chrome=83.0.4103.61)

Selenium 3.141.0 Python 3.8

KunduK

You need to provide some sleep() to load the value on the graph and then use below xpath to get the value.

driver.get("https://iot.app.initialstate.com/embed/#/tiles/bkt_kb448kawjvmhe")
time.sleep(3)
print(driver.find_element_by_xpath("(//div[@class='data-value']/b)[last()]").text.strip())

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I extract outgoing links from a website in python?

How can I extract the URLs from a website?

how to extract value from website with python?

How can I get the text from an temporary alert using chromedriver Selenium and Python?

How do I Extract ZIP code from a Website using selenium python

How can I search for and extract a particular value from a dataframe in python?

How to extract the product titles from the website using Selenium Python

How can I get the tooltip text from a website using selenium and python where the text comes from a javascript

How can I get and extract a number from website using Java?

How can I extract url links from IGN website

How can i download specifcs files from a website using Python + Selenium

How to extract data with selenium from a website?

How can I extract information from a HTML code using Python + Selenium?

Python Selenium Testing. How can I extract the Auto Suggestions from search box on Google Home Page?

Python-Selenium : How can I get access to this part of the website?

How can I parse a website using Selenium and Beautifulsoup in python?

How can I parse a website using Selenium and Beautifulsoup in python?

how can I upload image to this website with selenium in python

How do i extract data from a live website with python?

How can i extract href from this html using selenium?

How can I extract the text from a webelement using selenium

How can I extract a specific text in an html code with Selenium and Python

How do i extract data from yelp using selenium python

Can I run Selenium ChromeDriver with cookies from actual Chrome installation?

Get value from a website using selenium in python

Select hidden option value from source using python selenium chromedriver

How do I extract the information from the website?

How to extract the price for the security as text from the website through Python Selenium BeautifulSoup

How to extract ec2 instance details like name, memory from aws website using python selenium