When I try to find elements inside the current element, the search occurs in the whole web page
For example I get some element:
year_block = browser.find_element_by_xpath('some condition')
There are several similar elements of such kind but I make sure that I've got the proper element using:
print(year_block.get_attribute('innerHTML'))
And then I need to find list of elements inside "year_block"
I use:
plant_id_block_list = year_block.find_elements_by_xpath("//*[contains(text(), 'Plant number')]/following-sibling::input")
But in result I get the list of all such elements on a page instead of such elements only inside "year_block"
Where is the problem?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…