How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page? How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page? selenium selenium

How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page?


You should be able to use the method to select multiple elements that match your selector:

my_charts = driver.find_elements_by_css_selector("[id^='highcharts-'] > div:nth-child(1) > span > div > span")for chart in my_charts:    print chart.text

(you didn't mention what you were doing with those charts, but here I'm just printing whatever text might be associated with it)