Exclude a factor, the first preferred to think of regular expression, helpless toss half a day without success, feeling is selenium on the elements of Attrs press re search in action, $ on the end of the string detection is useless.
The beautifulsoup can be detected using the class of the output element of the element[' class '), but the BeautifulSoup object is no longer in the click Operation and does not meet expectations . Selenium does not have such a syntax and is selected through XPath:
ItemList = Driver.find_elements_by_xpath ('//div[@id = "Choose-color"]//div[@class = "dd"]//div[not (Contains (@class, " Disabled "))]
StackOverflow has a reference: Http://stackoverflow.com/questions/11024080/how-to-use-not-contains-in-xpath
Supplemental XPath usage:
Xpath=xpathexpression:locate an element using an XPath expression. xpath=//img[@alt = ' The image alt text '] xpath=//table[@id = ' table1 ']//tr[4]/td[2] xpath=//a[contains (@href, ' #id1 ')] Xpath=//a[contains (@href, ' #id1 ')]/@class xpath= (//table[@class = ' Stylee '])//th[text () = ' Theheadertext ']/. /td xpath=//input[@name = ' name2 ' and @value = ' yes '] xpath=//*[text () = "Right"]
Selenium grab elements exclude a specific class tag