The_last_call Posted April 12, 2019 Share Posted April 12, 2019 Hello everybody, this is my first request after spending the last night by trying to solve this problem. I really hope that somebody can help me with this. I try to click on a specific button to trigger an onclick event while using IE.au3, Here is my code: I also tryed out this version: But both doesn't work. Here is the sourcecode of the element want to click: Thank's for your help I'm a bit dispairing with this. Link to comment Share on other sites More sharing options...
The_last_call Posted April 12, 2019 Author Share Posted April 12, 2019 That will makes it a bit easier to read: Code1: Local $oIE = _IECreate("https://www.tradingview.com/chart/CPimMRTr/#", 1) _IELoadWait($oIE) $oSubmitClick = _IEGetObjById($oIE,"tv-screener-toolbar__button tv-screener-toolbar__button--space_right tv-screener-toolbar__button--export apply-common-tooltip-fixed") _IEAction($oSubmitClick, "click") _IELoadWait($oIE,2000) Code2: Local $oButs = _IETagNameGetCollection($oIE, "button") For $oBut In $oButs If StringInStr($oBut.classname, "tv-screener-toolbar__button tv-screener-toolbar__button--space_right tv-screener-toolbar__button--export apply-common-tooltip-fixed") Then _IEAction($oBut, "click") Next Sourcecode: <div tabindex="0" class="tv-screener-interval-select tv-dropdown tv-dropdown-behavior"><div class="tv-screener-toolbar__button tv-screener-toolbar__button--space_right tv-screener-toolbar__button--export apply-common-tooltip common-tooltip-fixed"><svg xmlns="http://www.w3.org/2000/svg" class="tv-screener-toolbar__button-icon tv-screener-toolbar__button-icon--export" viewBox="0 0 16 14" width="16" height="14"><g fill="none" stroke="#758696" stroke-width="1.5"><path d="M 15 9 v 4 H 1 V 9 M 8 9 V 0" /><path d="M 5 6 l 3 3 l 3 -3" /></g></svg></div> If someone need to copy parts of the code. Sorry for the circumstances. Link to comment Share on other sites More sharing options...
Danp2 Posted April 12, 2019 Share Posted April 12, 2019 Code1 won't work because you can't use an element's class to find it with _IEGetObjById. Code2 won't work because you are gathering button elements, when the desired element is actually a Div. Try searching for a matching Div instead -- Local $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If StringInStr($oDiv.classname, "tv-screener-toolbar__button tv-screener-toolbar__button--space_right tv-screener-toolbar__button--export apply-common-tooltip-fixed") Then _IEAction($oDiv, "click") Next The_last_call 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
The_last_call Posted April 12, 2019 Author Share Posted April 12, 2019 Hello Danp2, thank you so much, you can't imagin how many hours I spend last night for this. Here is the working code: Local $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If StringInStr($oDiv.classname, "tv-screener-toolbar__button tv-screener-toolbar__button--space_right tv-screener-toolbar__button--export apply-common-tooltip common-tooltip-fixed") Then _IEAction($oDiv, "click") Next Note the div was a bit different. I hope it supports someone who has the same request. Link to comment Share on other sites More sharing options...
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