DedInc / pyanty

Python module for controlling Dolphin browser profiles using Selenium, Pyppeteer, and Playwright. Includes Dolphin API for profile management.
https://pypi.org/project/pyanty
MIT License
45 stars 14 forks source link

Driver can't locate elements properly when Client Rects fingerprints are spoofed #23

Closed DeMonk8 closed 1 month ago

DeMonk8 commented 4 months ago

import pyanty as dolphin from pyanty import DolphinAPI, STABLE_CHROME_VERSION from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import dolphin_api_key, profile_id

DolphinAPI(api_key=dolphin_api_key) response = dolphin.run_profile(profile_id) port = response['automation']['port']

driver = dolphin.get_driver(port=port)

driver.get('https://www.google.com/') feeling_lucky_button_xpath= '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[4]/center/input[2]' WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, feeling_lucky_button_xpath))).click() driver.quit()

Error: selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (289, 132). Other element would receive the click: div class="o3j99 LLD4me yr19Zb LS8OJ">...</div (Session info: chrome=125.0.6422.60)

When "Client Rects" is set to "real" the above code works perfectly. Screenshot_29