gologinapp / pygologin

REST API provides programmatic access to GoLogin App. Create a new browser profile, get a list of all browser profiles, add a browser profile and running
Other
61 stars 42 forks source link

Selenium Script Freezes #49

Open dedsec995 opened 10 months ago

dedsec995 commented 10 months ago
from sys import platform
from selenium import webdriver
from gologin import GoLogin
from gologin import getRandomPort
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains

my_id = "64e3ecb646e7c97665afaab6"
chrome_driver_path = r"C:\chromedriver.exe"

gl = GoLogin({
    "token": "the_token",
    "profile_id": my_id
    })

debugger_address = gl.start()
service = Service(executable_path=chrome_driver_path)

chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("debuggerAddress", debugger_address)

driver = webdriver.Chrome(service=service, options=chrome_options)
driver.maximize_window()
driver.get("http://www.tinder.com")
time.sleep(9)
accept_btn = driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/div/div/div[1]/div[1]/button')
# actions = ActionChains(driver)
print("Found the element....Clicking")
# actions.click(accept_btn).perform()
accept_btn.click()
print("Clicked")
time.sleep(20)
driver.quit()
time.sleep(10)
gl.stop()

In the above example, the selenium script just freezes without any error or crash. Using gologin latest selenium driver 114. Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.134 Safari/537.36.

nikita5526 commented 10 months ago

Hello, @dedsec995 Please check if you are using a proxy in your profile? I can suggest making a clone of the profile and use the clone id

dedsec995 commented 10 months ago

Yes, We are using proxy in the profile. Also we are emulating android operating system

MacMarde commented 9 months ago

For me freezing too when I click an elment like this: driver.find_element(By.ID, 'CheckboxField').click()