V
V
vlados3323322020-10-24 11:48:27
Python
vlados332332, 2020-10-24 11:48:27

XPatch and Time to set a delay on the site when xpatch is found.?

Good afternoon, tell me how to stay on the site if he sees a certain Xpath ( xpath roughly speaking: let's stay here for 30 seconds )
and so that after the time expires, it closes // well, the next cycle follows it
Example:
If the "site" has the string "xpath" then, stay here for 31 seconds.

Or, so that he closes the page, as he stops seeing this line.
Here, as I understand it, the search for xpath every 5 seconds can be set, and if it is not found, then the site should close.

( fluctuated between difficulty levels, but I think it's more average than difficult. )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
ScriptKiddo, 2020-10-24
@vlados332332

if driver.find_element_by_xpath('**xpath**'):
    sleep(30)

A
Alexey Sundukov, 2020-10-24
@alekciy

Use from WebDriver wait passing XPath locator and timeout.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question