I'm trying to make bot click on X to close a popup but nothing happens, I tried using different elements to target the popup close button but nothing seems to work.
URL of the website is: https://vb.rebelbetting.com/login?r=%2f
Code trials:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.remote.webelement import WebElement
username = 'username'
password = 'password'
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(options=chrome_options)
driver.get('link/')
driver.maximize_window()
time.sleep(2)
driver.find_element("id", "inputEmail").send_keys(username)
driver.find_element("id", "inputPassword").send_keys(password)
driver.find_element('id', 'inputPassword').send_keys("\n")
time.sleep(5)
driver.find_element("id", "close").click()
I also tried using xpath and tried it on everything that is related to the X button itself:
driver.find_element("xpath", "//*[@id='backdrop']/div/span").click()
Snapshot of the element:
And this is html code for the popup
<span data-v-4f1211ad="" data-v-34fa3c14="" data-dismiss="true" class="close top-right" style="color: rgb(111, 181, 36); font-size: 2em; width: 1em; height: 1em; line-height: 1em; display: block; position: absolute;"><svg data-v-4f1211ad="" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" id="close" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x" style="stroke: rgb(0, 0, 0);"><line data-v-4f1211ad="" x1="18" y1="6" x2="6" y2="18"></line><line data-v-4f1211ad="" x1="6" y1="6" x2="18" y2="18"></line></svg></span>
<svg data-v-4f1211ad="" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" id="close" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x" style="stroke: rgb(0, 0, 0);"><line data-v-4f1211ad="" x1="18" y1="6" x2="6" y2="18"></line><line data-v-4f1211ad="" x1="6" y1="6" x2="18" y2="18"></line></svg>
<line data-v-4f1211ad="" x1="18" y1="6" x2="6" y2="18"></line>
<line data-v-4f1211ad="" x1="6" y1="6" x2="18" y2="18"></line>
I'm tried to make bot click on X to close a popup but nothing happens, I tried using different elements to target the popup close button but nothing seems to work.