Organ Posted November 1, 2020 Posted November 1, 2020 Hey guys, i need to click a button that doesnt have a name or id on a website in internet explorer. The button is the following: <button class="btn btn--anchor after--overlay pdgh0 facility" type="button"> Anlage <svg xmlns="http://www.w3.org/2000/svg" class="icon icon--arrow-down icon--toggle bg-brand text-white" role="img"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#arrow-down" /></svg></button> and then i also need to click this one a little bit after that (but i only need to know how to access it😞 <button class="btn btn--anchor after--overlay pdgh0 sport" type="button"> Sportart <svg xmlns="http://www.w3.org/2000/svg" class="icon icon--arrow-down icon--toggle bg-brand text-white" role="img"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#arrow-down" /></svg></button> I'm new to this and dont even know how to start. I tried to access it by using this: Local $anlage = _IEGetObjByName ($oIE, "facility") Sleep (3000) _IEAction ($anlage, "click") i also tried IEGetObjById and i tried different things as "name" or "id" but neither worked. I would appreciate some help, thanks
Danp2 Posted November 1, 2020 Posted November 1, 2020 You can search for the button element by it's innertext value, something like this -- Local $oButtons = _IETagNameGetCollection($oIE, "button") For $oButton In $oButtons If $oButton.innerText = "Anlage" Then _IEAction($oButton, 'click') ExitLoop EndIf Next Latest Webdriver UDF Release Webdriver Wiki FAQs
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now