0

I am trying to do a bot that automatically finds an available room for Zoom (so I can troll, because I'm bored).

It works, but from time to time it gets an error that the Submit button click was intercepted. I want my program to continue after the error, but it just stops. How can I fix this?

Here's the code:

    browser.get("https://www.zoomus.cn/j/1313141151?_x_zm_rtaid=GJwf9jNWTHasYv14WqiBZg.1593889587120.4853db3668ae0d51573cd748d7f1ded4&_x_zm_rhtaid=338")


class Buttons:
    ID_Box = browser.find_element_by_id("join-confno")
    Submit_BTN = browser.find_element_by_id("btnSubmit")


def CheckElement_Exist():
    try:
        browser.find_element(By.ID, "join-confno")
    except NoSuchElementException:
        return False
        pass
    return True


while CheckElement_Exist():
    Number_Random = choices(availableSymbols_Code, k=randint(9 + 5, 11 + 5))
    attempts += 1
    Buttons.ID_Box.send_keys(''.join(Number_Random))
    Buttons.Submit_BTN.click()
    time.sleep(0.5)
    Buttons.ID_Box.clear()
    time.sleep(3.5)


time_end = time.time()
time_took = round(time_end - time_end, 2)
Saved_Number = Number_Random
print(Fore.GREEN + "Room found in " + Style.RESET_ALL + Fore.RED + time_took + Style.RESET_ALL + Fore.GREEN
      + " seconds. Number is: " + Style.RESET_ALL + Fore.RED + Saved_Number + Style.RESET_ALL + Fore.GREEN + ".")

Here's the error:

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <a id="btnSubmit" role="button" href="javascript:;" class="btn btn-primary user submit disabled" disabled="disabled">...</a> is not clickable at point (324, 357). Other element would receive the click: <div class="controls">...</div>
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
CatGuy
  • 11
  • 2

1 Answers1

0

As the error clearly says,

Other element would receive the click: div class="controls"

It can happen due to various reasons,

  1. May be your submit button is out of page view, in this case consider try using any one code snippet before Buttons.Submit_BTN.click():
actions = ActionChains(driver)
actions.move_to_element(Submit_BTN).perform()

OR alternative to this:

driver.execute_script("arguments[0].scrollIntoView();", Submit_BTN);
  1. Or else you can try to to send 'ENTER' key to the Submit_BTN element instead of clicking the button:
Submit_BTN.send_keys(u'\ue007');
  1. If above options are not working there can be a wrapper element to the submit button. Try to find div class="controls" element on the page to get an idea on this error.

Hope this helps you to troll !! ;)

  • What i think it does it gets like whited from time to time and when its white you cant interact with it – CatGuy Jul 05 '20 at 14:25
  • The second option seems to work find it doesnt give error so if i tweak the time.sleep it should be perfect! Ty – CatGuy Jul 05 '20 at 14:29
  • Btw its the same thing i see there disabled = "disabled" when it gets whited out , is there a way to tell the program if its disabled dont click , if !disabled click – CatGuy Jul 05 '20 at 14:31
  • @CatGuy Yes, there's a way. You can `dis = Submit_BTN.get_attribute("disabled")` and then you can check value of 'dis' if it is disabled or something else. Please upvote if this works! Thanks! – Vihang Sangai Jul 05 '20 at 15:04