Python + Selenium: get span value from “ng-bind”
问题 So I have Selenium code that goes to a page using chrome. Now at that page, there is this HTML; <span ngbind="pageData.Message">Heloooo</span> How can I get the value using python and Selenium? So only the Heloooo . Thanks! 回答1: You can use the following CSS Selector for locating the element: span[ngbind='pageData.Message'] Code: element = driver.find_element_by_css_selector("span[ngbind='pageData.Message']") print(element.text) # Will print the "Heloooo" value. Hope it helps you! 回答2: You