uncommon Posted June 20, 2013 Posted June 20, 2013 (edited) If you can tell I have been trying to interact with some google divs that have roles like buttons but so far my trys have yeilded no results. Here is what I have done... $create = _IEGetObjByClass($googledoc, "goog-inline-block jfk-button jfk-button-primary goog-toolbar-item-new") _IEAction($create, "focus") $create.fireEvent("onmousedown") Sleep(500) $create.fireEvent("onmouseup") _IEAction($create, "click") IS there something I am missing? Please any comments are welcome. Edited June 20, 2013 by uncommon No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll()
jdelaney Posted June 20, 2013 Posted June 20, 2013 (edited) where is $create defined (read like eddie murphy in coming to america...waiter, try my soup) Edited June 20, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Moderators big_daddy Posted June 20, 2013 Moderators Posted June 20, 2013 I have not tested it yet, but this may help. '?do=embed' frameborder='0' data-embedContent>>
uncommon Posted June 20, 2013 Author Posted June 20, 2013 where is $create defined (read like eddie murphy in coming to america...waiter, try my soup) Sorry it should have been $create = _IEGetObjByClass($googledoc, "goog-inline-block jfk-button jfk-button-primary goog-toolbar-item-new") No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll()
uncommon Posted June 20, 2013 Author Posted June 20, 2013 I have not tested it yet, but this may help. '?do=embed' frameborder='0' data-embedContent>> I could get that UDF to work, looks through some of the fuctions. I think it was mostly using _IEgetobjectbyID () that does not really applly here, so it seems No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll()
Solution bogQ Posted June 21, 2013 Solution Posted June 21, 2013 (edited) it do apply, only problem is (i think) that google refuse to take action.if you dont finde beter solution this messy code can probably help you in same way #include <IE.au3> $winname = 'My Drive' $buffer = _IEAttach($winname) $colLinks = _IETagNameGetCollection($buffer, 'div') For $oLink In $colLinks If $oLink.className() = "goog-inline-block jfk-button jfk-button-primary goog-toolbar-item-new" Then $x = _IEPropertyGet($oLink, 'screenx') $y = _IEPropertyGet($oLink, 'screeny') If $x > -1 And $y > -1 Then $pos = ControlGetPos($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]') $pos_win = WinGetPos($winname) ControlClick($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]', 'left', 1, $x - ($pos_win[0] + $pos[0]), $y - ($pos_win[1] + $pos[1])) Else MsgBox(0,'Win need not to b minimized for this to work','') EndIf EndIf Next Edited June 21, 2013 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
uncommon Posted June 21, 2013 Author Posted June 21, 2013 it do apply, only problem is (i think) that google refuse to take action. if you dont finde beter solution this messy code can probably help you in same way #include <IE.au3> $winname = 'My Drive' $buffer = _IEAttach($winname) $colLinks = _IETagNameGetCollection($buffer, 'div') For $oLink In $colLinks If $oLink.className() = "goog-inline-block jfk-button jfk-button-primary goog-toolbar-item-new" Then $x = _IEPropertyGet($oLink, 'screenx') $y = _IEPropertyGet($oLink, 'screeny') If $x > -1 And $y > -1 Then $pos = ControlGetPos($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]') $pos_win = WinGetPos($winname) ControlClick($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]', 'left', 1, $x - ($pos_win[0] + $pos[0]), $y - ($pos_win[1] + $pos[1])) Else MsgBox(0,'Win need not to b minimized for this to work','') EndIf EndIf Next I love you. If I have see you in real life, I owe you a 6pack Here is the revistion to make this work a bit faster without the loop, thanks so much! expandcollapse popup_IELoadWait($googledoc) _IENavigate($googledoc, "https://drive.google.com/") $oLink = _IEGetObjByClass($googledoc, "goog-inline-block jfk-button jfk-button-primary goog-toolbar-item-new");main spreedsheet $winname = _IEPropertyGet($googledoc, "title") &' - Windows Internet Explorer' $x = _IEPropertyGet($oLink, 'screenx') $y = _IEPropertyGet($oLink, 'screeny') If $x > -1 And $y > -1 Then $pos = ControlGetPos($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]') $pos_win = WinGetPos($winname) ControlClick($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]', 'left', 1, $x - ($pos_win[0] + $pos[0]), $y - ($pos_win[1] + $pos[1])) Else MsgBox(0, 'Error', 'window is minimized, or off screen') EndIf Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0) If Not IsObj($o_object) Then __IEErrorNotify("Error", "_IEGetObjByClass", "$_IEStatus_InvalidDataType") SetError($_IEStatus_InvalidDataType, 1) Return 0 EndIf ; If Not __IEIsObjType($o_object, "browserdom") Then __IEErrorNotify("Error", "_IEGetObjByClass", "$_IEStatus_InvalidObjectType") SetError($_IEStatus_InvalidObjectType, 1) Return 0 EndIf ; Local $i_found = 0 ; $o_tags = _IETagNameAllGetCollection($o_object) For $o_tag In $o_tags If String($o_tag.className) = $s_Class Then If ($i_found = $i_index) Then SetError($_IEStatus_Success) Return $o_tag Else $i_found += 1 EndIf EndIf Next ; __IEErrorNotify("Warning", "_IEGetObjByClass", "$_IEStatus_NoMatch", $s_Class) SetError($_IEStatus_NoMatch, 2) Return 0 EndFunc ;==>_IEGetObjByClass No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll()
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