kaliiiiiiiiii / Selenium-Profiles

undetected Selenium using chromedriver and emulation / device profiles
Other
272 stars 29 forks source link

Send_keys action chains error? #91

Closed AlexPaiva closed 1 year ago

AlexPaiva commented 1 year ago

Trying to click a element and send_keys: <input type="text" placeholder="Email address" autocomplete="email" name="email" class="11to27l-InputContainer etcs7ny1" value="">

But when I do it with:

driver.find_element(By.XPATH,'//*[@id="loginContainer"]/div[1]/form/div[5]/div/input').click()
driver.find_element(By.XPATH,'//*[@id="loginContainer"]/div[1]/form/div[5]/div/input').send_keys("test")

It doesn't work as it should, most likely because the site forces a click to be able to edit text? Because after I send the keys they show but the input element still has a null value and if I manually click it and type with my keyboard it then inserts into the value of the input tag so something is not working here?

I usually go with action chains but trying them with move_to or anything (I tried with a simple click or anything, I even tried with waitcondition instead of find_element and it gives the same exact error) gives error:

Traceback (most recent call last):
  File "C:\Users\AA\Downloads\Bots\TikTok System\TikTok Account Creator\123.py", line 74, in <module>
    ActionChains(driver).move_to_element(em).pause(random.uniform(0.5, 1.5)).click(em).perform()
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\action_chains.py", line 232, in move_to_element
    self.w3c_actions.pointer_action.move_to(to_element)
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\actions\pointer_actions.py", line 87, in move_to
    raise AttributeError("move_to requires a WebElement")
AttributeError: move_to requires a WebElement
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000202623FBA30>
Traceback (most recent call last):
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <coroutine object WebSocketCommonProtocol.close_connection at 0x00000202644B76F0>
Traceback (most recent call last):
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1338, in close_connection
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1356, in close_transport
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1380, in wait_for_connection_lost
  File "C:\Users\AA\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\async_timeout.py", line 74, in timeout
RuntimeError: no running event loop

And the code I use is:

em = driver.find_element(By.XPATH,'//*[@id="loginContainer"]/div[1]/form/div[5]/div/input')
time.sleep(.25)
ActionChains(driver).move_to_element(em).pause(random.uniform(0.5, 1.5)).click(em).perform()

What could be wrong? Any ideas for a fix?

Environment:

kaliiiiiiiiii commented 1 year ago

move to https://github.com/kaliiiiiiiiii/Selenium-Driverless/issues/5

kaliiiiiiiiii commented 1 year ago

not implemented yet for driverless, comming soon