问题
I am performing automation on a web page, the problem is i cannot locate a web element because it has identical attributes to that of other 20 web elements with similar parents and children, with one dynamicity i.e the id, which changes every time i refresh the page. How do i locate the web element?
for z in web_elements:
print(z.get_attribute("innerHTML"))
width = browser.find_element_by_xpath('//input[contains(@class, "cke_dialog_ui_input_text")]')
width.click()
I tried searching for the web element using loops no success though
来源:https://stackoverflow.com/questions/65540342/how-to-locate-web-elements-with-similar-attributes