Skip to content

Instantly share code, notes, and snippets.

@j-gonzal
Created July 29, 2019 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-gonzal/7ddc4b3c6378b712560c9b043363dc63 to your computer and use it in GitHub Desktop.
Save j-gonzal/7ddc4b3c6378b712560c9b043363dc63 to your computer and use it in GitHub Desktop.
Clicking out of a pop-up newsletter box
Display the source blob
Display the rendered blob
Raw
index = 1
while index <= 7:
time.sleep(4)
try:
element = driver.find_element_by_xpath('//a[@id="drip-close-9704"]')
element.click()
time.sleep(1)
@aoot
Copy link

aoot commented Feb 9, 2022

@j-gonzal, doesn't seem like gist like the file format of .ipynb, perhaps a .py would work better?

Here is the code for those looking for it.

index = 1
while index <= 7:
    time.sleep(4)
    
    try:
        element = driver.find_element_by_xpath('//a[@id="drip-close-9704"]')
        element.click()
        time.sleep(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment