Skip to content

Instantly share code, notes, and snippets.

@converge
Last active November 19, 2018 23:15
Show Gist options
  • Save converge/4349e9f0e0411a08094a3a42f97e1280 to your computer and use it in GitHub Desktop.
Save converge/4349e9f0e0411a08094a3a42f97e1280 to your computer and use it in GitHub Desktop.
try:
WebDriverWait(self.driver, 10).until(
EC.presence_of_element_located((By.ID, "emailFrame"))
)
self.driver.switch_to_frame(
self.driver.find_element_by_id("emailFrame"))
# click first image
'''
WebDriverWait(self.driver, 180).until(
EC.presence_of_element_located((By.XPATH, "//img"))
)
'''
""" I added it ---> """
pre = browser.find_element_by_tag_name("html").text
cupom = re.search('(?<=\*\*:\s)\w{10}', pre, re.IGNORECASE)
if cupom:
cupom = cupom.group(0)
print(cupom)
else:
logger.warning('Unable to locate cupom code')
""" end """
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment