简体   繁体   中英

Python / Selenium - search following elements too too long time

I have selenium find element line: element.find_elements(By.XPATH, './following::input')

But somehow it took waaaay to long to search for all next elements on the page (around 2/3 second !!!)

Is it way around it (or I have done something wrong)???

Just make it like this and it will sort this problem (will search for the following 10 elements instead of all)

  • element.find_elements(By.XPATH, './/following::input[position()<=10]')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM