dropdown box select #50
-
how can I chose from a dropdown box elements using Selenium-Driverless?? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Just set the do |
Beta Was this translation helpful? Give feedback.
-
hi,
thank you for your quick response
I already tried, elem.execute_script("obj.value = 'some_option_id'")
![Screenshot 2023-09-07 194827](https://github.com/kaliiiiiiiiii/Selenium-Driverless/assets/110057229/cf615f76-3619-4368-9f08-a86421d190e9)
It's not working dear, please can you check my web application here below
https://www.airbnb.com/login
[https://a0.muscache.com/im/pictures/fe7217ff-0b24-438d-880d-b94722c75bf5.jpg]<https://www.airbnb.com/login>
Log In / Sign Up - Airbnb<https://www.airbnb.com/login>
Join a global community of travelers and local hosts on Airbnb. Log in with your email address, Facebook, or Google.
www.airbnb.com
…________________________________
From: kaliiiiiiiiiii ***@***.***>
Sent: Thursday, September 7, 2023 2:04 PM
To: kaliiiiiiiiii/Selenium-Driverless ***@***.***>
Cc: madapro ***@***.***>; Author ***@***.***>
Subject: Re: [kaliiiiiiiiii/Selenium-Driverless] dropdown box select (Discussion #50)
Just set the do elem.execute_script("obj.value = 'some_option_id'")
I'll be implementing some more "human" way in some time
—
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2HVODJV67KZMR3P3AQMTB3XZGS3NANCNFSM6AAAAAA4OW6PFA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
```
Traceback (most recent call last):
File "D:\Desktop\newWork\airbnb\test.py", line 62, in <module>
asyncio.run(main())
File "C:\Program Files\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Desktop\newWork\airbnb\test.py", line 31, in main
await country.click()
File "C:\Users\Assem\AppData\Roaming\Python\Python311\site-packages\selenium_driverless\types\webelement.py", line 273, in click
raise e
File "C:\Users\Assem\AppData\Roaming\Python\Python311\site-packages\selenium_driverless\types\webelement.py", line 266, in click
x, y = await self.mid_location(bias=bias, resolution=resolution, debug=debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Assem\AppData\Roaming\Python\Python311\site-packages\selenium_driverless\types\webelement.py", line 311, in mid_location
box = await self.box_model
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Assem\AppData\Roaming\Python\Python311\site-packages\selenium_driverless\types\webelement.py", line 497, in box_model
res = await self._driver.execute_cdp_cmd("DOM.getBoxModel", {"nodeId": node_id})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Assem\AppData\Roaming\Python\Python311\site-packages\selenium_driverless\webdriver.py", line 1332, in execute_cdp_cmd
result = await socket.exec(method=cmd, params=cmd_args, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Assem\AppData\Roaming\Python\Python311\site-packages\cdp_socket\socket.py", line 69, in exec
return await asyncio.wait_for(self._responses[_id], timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\tasks.py", line 479, in wait_for
return fut.result()
^^^^^^^^^^^^
cdp_socket.exceptions.CDPError: {'code': -32000, 'message': 'Could not compute box model.'}
```
…________________________________
From: kaliiiiiiiiiii ***@***.***>
Sent: Thursday, September 7, 2023 8:11 PM
To: kaliiiiiiiiii/Selenium-Driverless ***@***.***>
Cc: madapro ***@***.***>; Author ***@***.***>
Subject: Re: [kaliiiiiiiiii/Selenium-Driverless] dropdown box select (Discussion #50)
then you could try:
1. click on the select element
2. identify the desired option element
3. click on the desired option element
Note: scrolling will happen automatically at elem.click() and isn't needed additionally.
—
Reply to this email directly, view it on GitHub<#50 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2HVODOM4GEYJYA6HSFXLMDXZH55XANCNFSM6AAAAAA4OW6PFA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
ok, let me know when you are done, thanks
…________________________________
From: kaliiiiiiiiiii ***@***.***>
Sent: Thursday, September 7, 2023 9:00 PM
To: kaliiiiiiiiii/Selenium-Driverless ***@***.***>
Cc: madapro ***@***.***>; Author ***@***.***>
Subject: Re: [kaliiiiiiiiii/Selenium-Driverless] dropdown box select (Discussion #50)
Yep, that's an issue I've got sometimes as well. tbh, I don't know why it occurs. Probably some bug in Chrome.
I'll be chaging that implementation anyways to use javascript in some future.
—
Reply to this email directly, view it on GitHub<#50 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2HVODORPI2SP446N3MLLI3XZIDTVANCNFSM6AAAAAA4OW6PFA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
hello, did you fix that issue or not yet??????? |
Beta Was this translation helpful? Give feedback.
@madapro see #94 (comment)