Finding elements by xpath pattern in Selenium python -
i working selenium python , lettuce test django application.
there many elements having xpath in following pattern , don't know how many of these elements exists in document.
.//*[@id='accordion-note-1'] .//*[@id='accordion-note-2'] .//*[@id='accordion-note-3'] .//*[@id='accordion-note-4']
is there way use pattern in driver.find_elements_by_xpath ?
purpose items having pattern of xpath.
not sure work, can try using below xpath:
.//*[starts-with(@id, 'accordion-note')]
here link http://www.zvon.org/xxl/xsltreference/output/function_starts-with.html
u can use contain here like
.//*[contains(@id, 'accordion-note')]
Comments
Post a Comment