Closed ahmedabdelhamedz closed 1 year ago
@ahmedabdelhamedz I'm actually currently rewriting that logic for the next release. Stay tight therefore:)
@ahmedabdelhamedz
This should be resolved with selenium-driverless==1.6
Please close this issue if it's fixed now:)
@ahmedabdelhamedz This should be resolved with
selenium-driverless==1.6
Please close this issue if it's fixed now:)
i tried latest update [selenium-driverless==1.6.1
] but it give me new error :
This package has a "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)" Licence.
therefore, you'll have to ask the developer first, if you want to use this package for your buisiness.
https://github.com/kaliiiiiiiiii/Selenium-Driverless
Traceback (most recent call last):
File "C:\Users\samm\PycharmProjects\python\main1.py", line 47, in <module>
asyncio.run(main())
File "C:\Users\samm\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\samm\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\samm\PycharmProjects\python\main1.py", line 30, in main
em2 = await driver.find_element(By.NAME,'q')
File "C:\Users\samm\PycharmProjects\python\venv\lib\site-packages\selenium_driverless\webdriver.py", line 662, in find_element
return await target.find_element(by=by, value=value, parent=parent, timeout=timeout)
File "C:\Users\samm\PycharmProjects\python\venv\lib\site-packages\selenium_driverless\types\target.py", line 523, in find_element
return await parent.find_element(by=by, value=value, timeout=timeout)
File "C:\Users\samm\PycharmProjects\python\venv\lib\site-packages\selenium_driverless\types\webelement.py", line 250, in find_element
return elems[idx]
TypeError: 'JSUnserializable' object is not subscriptable
Process finished with exit code 1
how can i solve this problem please ?
@ahmedabdelhamedz This should be resolved with
selenium-driverless==1.6
Please close this issue if it's fixed now:)i tried latest update [
selenium-driverless==1.6.1
] but it give me new error :This package has a "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)" Licence. therefore, you'll have to ask the developer first, if you want to use this package for your buisiness. https://github.com/kaliiiiiiiiii/Selenium-Driverless Traceback (most recent call last): File "C:\Users\samm\PycharmProjects\python\main1.py", line 47, in <module> asyncio.run(main()) File "C:\Users\samm\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\samm\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "C:\Users\samm\PycharmProjects\python\main1.py", line 30, in main em2 = await driver.find_element(By.NAME,'q') File "C:\Users\samm\PycharmProjects\python\venv\lib\site-packages\selenium_driverless\webdriver.py", line 662, in find_element return await target.find_element(by=by, value=value, parent=parent, timeout=timeout) File "C:\Users\samm\PycharmProjects\python\venv\lib\site-packages\selenium_driverless\types\target.py", line 523, in find_element return await parent.find_element(by=by, value=value, timeout=timeout) File "C:\Users\samm\PycharmProjects\python\venv\lib\site-packages\selenium_driverless\types\webelement.py", line 250, in find_element return elems[idx] TypeError: 'JSUnserializable' object is not subscriptable Process finished with exit code 1
how can i solve this problem please ?
Actually, that might be my bad. I'll give it a try:)
@ahmedabdelhamedz The followimg code:
async def main():
options = webdriver.ChromeOptions()
async with webdriver.Chrome(options=options) as driver:
await driver.maximize_window()
await driver.get("https://google.com", wait_load=False)
reject_cookies = await driver.find_element(By.XPATH, "/html/body/div[2]/div[3]/div[3]/span/div/div/div/div[3]/div[1]/button[1]/div", timeout=30)
await asyncio.sleep(1)
await reject_cookies.click()
google_search = await driver.find_element(By.NAME, 'q', timeout=300)
await google_search.write('domain.com')
google_enter = await driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[2]/div[2]/div[5]/center/input[1]', timeout=10)
works for me just fine. Closing therefore for now.
If you find any other bugs, feel free to report them with a minimum reporducible example
EDIT: Your original issue might be: https://github.com/kaliiiiiiiiii/Selenium-Driverless/issues/81
@ahmedabdelhamedz The followimg code:
async def main(): options = webdriver.ChromeOptions() async with webdriver.Chrome(options=options) as driver: await driver.maximize_window() await driver.get("https://google.com", wait_load=False) reject_cookies = await driver.find_element(By.XPATH, "/html/body/div[2]/div[3]/div[3]/span/div/div/div/div[3]/div[1]/button[1]/div", timeout=30) await asyncio.sleep(1) await reject_cookies.click() google_search = await driver.find_element(By.NAME, 'q', timeout=300) await google_search.write('domain.com') google_enter = await driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[2]/div[2]/div[5]/center/input[1]', timeout=10)
works for me just fine. Closing therefore for now.
If you find any other bugs, feel free to report them with a minimum reporducible example
EDIT: Your original issue might be: #81
i tried your code as following
` from selenium_driverless import webdriver from selenium_driverless.types.by import By import asyncio import time import numpy as np
async def main(): options = webdriver.ChromeOptions() async with webdriver.Chrome(options=options) as driver: await driver.maximize_window() await driver.get("https://google.com", wait_load=False) reject_cookies = await driver.find_element(By.XPATH, "/html/body/div[2]/div[3]/div[3]/span/div/div/div/div[3]/div[1]/button[1]/div", timeout=30) await asyncio.sleep(1) await reject_cookies.click() google_search = await driver.find_element(By.NAME, 'q', timeout=300) await google_search.write('domain.com') google_enter = await driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[2]/div[2]/div[5]/center/input[1]', timeout=10) input() asyncio.run(main())`
i got the same error TypeError: 'JSUnserializable' object is not subscriptable
is there any solution? i think there wAS PROblem to find elements
@ahmedabdelhamedz can you try do:
elems = await driver.find_elements(By.XPATH, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[2]/div[2]/div[5]/center/input[1]')
await elems.__exec__("console.log(obj)")
and then provide a screenshot of what you got in the developer-console ?
@ahmedabdelhamedz can you try do:
elems = await driver.find_elements(By.XPATH, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[2]/div[2]/div[5]/center/input[1]') await elems.__exec__("console.log(obj)")
and then provide a screenshot of what you got in the developer-console ?
i upload two screen shots first run code and second screenshot run code in debug mode in pycharm
@ahmedabdelhamedz can you try do:
elems = await driver.find_elements(By.XPATH, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[2]/div[2]/div[5]/center/input[1]') await elems.__exec__("console.log(obj)")
and then provide a screenshot of what you got in the developer-console ?
i upload two screen shots first run code and second screenshot run code in debug mode in pycharm
Thanks! I meant the developer console in chrome tho haha!
haha sorry brother i upload the screenshot of developer console in chrome i appreciate your help and support
hello please i tried Selenium-Driverless library but when i use while loop to scroll down and up after it click on google search result it appear to me this error can i know how to solve a problem