Jump to content

vpn

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by vpn

  1. Hi PsaltyDS, Thank you for your kindness. I really feel I am not smart but ...you refer to following function correct?http://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_GetOverlappedResult.htm May I have simple sample how to use this function? Thanks.
  2. Hi, I am new to AutoIt. I want to scroll browser window with proper scrolling location. I mean following src I created scrolls. And, say the web content between following scroll locations has invisible content between the 2 location since y=0 to 500 is a big jump. I want it to scroll more seamlessly. Could you help me on this? 1. First : $oIE.document.parentwindow.scroll(0,0) 2. Next: $oIE.document.parentwindow.scroll(0,500) Scenario: 1. Open URL like http://www.yahoo.com/ with browser (IE8) manually. 2. Run the following src. #Include <IE.au3> WinActivate("[CLASS:IEFrame]") WinMove("[CLASS:IEFrame]", "", 0, 0) $sURL = ControlGetText("[CLASS:IEFrame]", "", "Edit1") $oIE = _IEAttach($sURL, "url") $oBody = $oIE.document.body $oHtml = $oIE.document.documentElement $Width = $oBody.scrollWidth $Height = $oHtml.scrollHeight ;Set Browser Width and Height $oIE.width = $Width + 100 $oIE.height = 500 ; force Browser window height ; Scroll to Top $oIE.document.parentWindow.scroll(0,0) $cnt = Ceiling($Height / 500) For $i = 1 to $cnt sleep(2000) $scrollHeight = $i * 500 $oIE.document.parentWindow.scroll(0,$scrollHeight) Next Please, let me now if you have any question!
  3. That is a great work!! Do you have any idea if I want to do following scenario? 1. open browser manually instead of creating IE object within AutoIt. 2. capture entire webpage.
  4. Hi PsaltyDS, Thank you for the working sample! it really help me a lot! But, I actually have further questions. Could you please help me on this? Question 1: I made a modification to the src. Now I use ControlGetText("[CLASS:IEFrame]", "", "Edit1") to get the URL in order to get URL dynamically. It works, but I have no idea why it's "Edit1"? Isn't that something like [ToolbarWindow32;INSTANCE2]? Window Info tool does not detect "Edit1." So where does it come from? Question 2: In the src, you suggested me to use _IEAttach($sURL, "url"). It works. But, I can not understand why since following Function Reference confuses me a lot in comparison to what you did. - http://www.autoitscript.com/autoit3/docs/libfunctions/_IEAttach.htm Could you please explain a bit more? Question 3: Now I added select file section to the src. And, it does not work. But, the strange thing is that it actually works if I run this section from separate .exe by creating another .au3 with only select file section and compile. Why it does not work as a single file just like the src you can see here? #include <IE.au3> _IEErrorHandlerRegister() WinActivate("[CLASS:IEFrame]") Global $sURL = ControlGetText("[CLASS:IEFrame]", "", "Edit1") #region Global $sURL = "http://cgi-lib.berkeley.edu/ex/fup.html" Global $oIE = _IEAttach($sURL, "url") Global $oButton = _IEGetObjByName($oIE, "upfile") _IEAction($oButton, "click") #region MsgBox(64, "Wait", "Click OK to continue") Sleep(2000) ; Select File _WinWaitActivate("[CLASS:#32770]","") WinActivate("[CLASS:#32770]","") ControlSetText("[CLASS:#32770]", "","[CLASS:Edit; INSTANCE:1]","test.txt") ControlClick("[CLASS:#32770]", "","[CLASS:Button; INSTANCE:2]") ; Submit form WinActivate("[CLASS:IEFrame]") $oForm = _IEFormGetCollection($oIE, 0) ; Get first form _IEFormSubmit($oForm) #region --- Internal functions Au3Recorder Start --- Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc #endregion --- Internal functions Au3Recorder End --- Thanks!
  5. Hi, I am new to AutoIt. Could anyone answer the following question regarding to _IEAttach? Question 1: Scenario: 1. open browser manually (without AutoIt). - http://cgi-lib.berkeley.edu/ex/fup.html 2. click browse button using AutoIt here is the AutoIt src I created, and it does not work! Could you help me on this? #include <IE.au3> WinActivate("[CLASS:IEFrame]") Dim $oHandle = WinGetHandle("[CLASS:IEFrame]") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : WinGetHandle("[CLASS:IEFrame]") = ' & WinGetHandle("[CLASS:IEFrame]") & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Dim $oTitle = WinGetTitle($oHandle) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : WinGetTitle($oHandle) = ' & WinGetTitle($oHandle) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Dim $oIE = _IEAttach($oTitle) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : _IEAttach($oTitle) = ' & _IEAttach($oTitle) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Dim $oButton = _IEGetObjByName($oIE,"upfile") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : _IEGetObjByName($oIE,"upfile") = ' & _IEGetObjByName($oIE,"upfile") & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console _IEAction($oButton,"click") Error Msg: --> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch @@ Debug(9) : _IEAttach($oTitle) = 0 >Error code: 7 Question 2: Could you also help me how to click "Press" button, which has neither id nor name element? - http://cgi-lib.berkeley.edu/ex/fup.html Thank you in advance!
×
×
  • Create New...