I am unable to get past this check. Even though I click it goes back to this state.
I tried using:
- Browsers data and profile so that all the history, cookie and cache is present but still
- Without using profile and data
- By running Chromium browser on using --remote-debugging-port and connecting selenium to it. It is failing in all 3.
If I copy the link manually in the same selenium session and paste in new tab and then click the check box it works.
from os import path
from time import sleep
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
chrome_options = Options()
chrome_options.add_argument("profile-directory=Default")
chrome_options.add_argument("user-data-dir=/home/abhishek/.config/chromium/")
chrome_options.binary_location = "/usr/bin/chromium"
chrome_options.add_argument("user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.79")
try:
driver = Chrome(options=chrome_options,
service=Service(executable_path=path.join("/home", "abhishek", "opt",
"chromedriver_linux", "chromedriver")))
driver.maximize_window()
driver.get("https://etherscan.io")
sleep(5)
input_box = driver.find_element(By.ID, "search-panel")
input_box.click()
sleep(1)
input_box.send_keys("0x896463c65b70da9bbe267c2feb97ab59fc715506")
sleep(5)
driver.find_element(By.CSS_SELECTOR, "div.flex-fill.text-truncate").click()
sleep(6)
driver.find_element(By.ID, "dropdownMenuBalance").click()
sleep(2)
driver.execute_script("window.scrollBy(0, 450)")
sleep(1)
driver.find_element(By.XPATH, "//i[@class='far fa-wallet me-1']").click()
sleep(20)
except Exception as e:
print("OUT", e)
driver.close()
Please help