Objective
Recently saw a group of small partners posted a set of interview questions, and recently job-hopping gold season, small series can not help but take a little time to summarize the next, the answer is not appropriate place to welcome you master Pat Brick pointing. How do I determine if an element exists in selenium? First of all, there is no such method in selenium, judging elements exist to write a method of their own. Elements exist in several forms, one is that the page has more than one element of the properties of the duplicate, this direct operation will be error; There is also a page-hidden element operation will also error judgment method reference this: Selenium2+python Automation 36-Judging element existence two, Can the elements of hidden or display = None in Selenium be located? Positioning is can be positioned to, but can not operate, it is possible to judge the element is_displayed () (I have not been inside this positioning in the end is a few meaning, as long as the elements on the page, I think can be positioned to, really not, small can crawl source selenium2+ Python Automation 37-Crawl page source code (PAGE_SOURCE), can not operate that is another matter) iii. how to ensure the success rate of operation elements in selenium? So how do I ensure that the element I clicked on must be clickable? One is the implicit wait: driver.implicitly_wait () The other is an explicit wait: webdriverwait () Wait a little longer refer to this article: selenium2+ Python Automation 38-Display Wait (webdriverwait)
Selenium2+python Automation 39-Questions about the interview "reprint"