I'm learning how to do RPA, and a lot of what I want to accomplish involves manipulating checkboxes and text fields on Chrome. I'm trying to find a way to either:
- Return a list of all elements of a specific type in Chrome (For example, all the element IDs of checkboxes, buttons, or text fields).
or
- Have a user click on an element or use a hot key while hovering over an element to get the element ID.
The idea is that if I can have the element to manipulate selected by the user while the program is running, I can automate tasks more efficiently without having to change the parameters by manually inspecting the element in Chrome and changing the code.
Basically I'm trying to create a crude element selector in Python, or to just display a list of elements so the user can choose which element to interact with.
Currently I'm attempting to find the syntax to return all elements in the active window using pywinauto, and am exploring the use of Beautiful Soup to parse the HTML. However I assume there must be a simple one or two line code to do this, so if possible I would like to learn how to do it correctly rather than hack together a crude function that accomplishes it ineffectively.