0
In this code I intend to put a timer before each click, this timer needs to wait 2 to 5 seconds and the time should be random, for example 2.4 seconds, 3.1 seconds, always a random time before each click. how would you guys do this? I’m young and having a hard time ;-;
def compra_item(self, driver, link):
self.logger.info("Abrindo.")
driver.get(link)
self.logger.info("Clicando...")
driver.find_element_by_css_selector(".btn.btn_big.color").click()
self.logger.info("Confirmando...")
driver.find_element_by_css_selector("button[type=submit]").click()
main_text = driver.page_source
if "flashNoticeInfo" in main_text:
msg = driver.find_element_by_id('flashNoticeInfo').text
self.logger.info(msg)
self.logger.info("Retornando.")