Jump to content

Search the Community

Showing results for tags '_IECreate'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 12 results

  1. Hi All, I've tried to create a script to browse to a web page in IE, but it only works for some sites, I've tried to simplify the script as much as possible, hoping you can point me in the right direction - thanks. This one going to Google does work: #include <IE.au3> $oIE = _IECreate("https://www.google.com.au/", 0, 1, 1) _IELoadWait($oIE) _IEQuit($oIE) But this one going to OneDrive opens the IE page, but fails immediately returning the errors, and the IE window is not closed: --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.) --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-2 Error from function _IEQuit, $_IESTATUS_InvalidObjectType #include <IE.au3> $oIE = _IECreate("https://abccorp-my.sharepoint.com/", 0, 1, 1) _IELoadWait($oIE) _IEQuit($oIE) Even if I put a sleep timer in for 10 seconds after the _IECreate it still doesn't work Thanks all!
  2. Hi I'm trying to: 1) Open a hidden browser session 2) Do some stuff in the background 3) Make the hidden window visible This is my code: Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $oIE = _IECreate("https://www.google.co.uk/",0,0) $oSearchBox = _IEGetObjById($oIE, "lst-ib") $oSearchBox.innertext = "AutoIT" $oForm = _IEFormGetObjByName($oIE,"f") _IEFormSubmit($oForm) WinSetState("Google","",@SW_SHOW) It dosen't work The last line does make the window visible but it is an empty greyed out box that disappears as soon as I click on it. I have a sort of workaround that hides the browser window as soon as I have created it which works fine: $oIE = _IECreate("https://www.google.co.uk/") WinSetState("Google","",@SW_HIDE) . . . WinSetState("Google","",@SW_SHOW) But this looks a bit pants as the newly created window flashes on then off of the screen. Am I using the wrong method to make the browser window visible? Thanks
  3. Hello, I need to pull data from company intranet website. I created a script that I can give a list of project numbers and it will open up the the related webpage for each project, save the html comments for that project, then move on to the next. However my problem comes in that each time I open up a project it locks it for other users, and if you just exit the page it keeps it locked, you have to actually press the "close" button on the page. So I'm not sure how to deal with this as I end up just locking every project in my name when I run my program as I don't understand the nature of how the website is built. I don't understand how to close with just using my automation code without manually having to press the stupid button. My Function: Func Getscript($ProjectAddress) ;getting the page source code and storing it into text file for easy reading it $file = FileOpen(@ScriptDir & "\source.txt", 10) $IE = _IECreate($ProjectAddress & ".html", 0, 0) $source = _IEDocReadHTML($IE) FileWrite($file, $source) $target_source = _StringBetween($source, "<BODY>", "</BODY>") ; only take content between the specified tags _IEQuit($IE) FileClose($file) return $target_source[0] EndFunc ;==>Getscript Source Code I got from website that I think is relevant: function closeForm(){ if(topButtonEnabled("closeButton")){ parent.mainFrame.closeForm(); } } <button id="closeButton" class="saveCloseButton" style="LEFT: 77px;" onclick=closeForm()>&nbsp;Close&nbsp;</button> Any Ideas of how to tell website to either activate the closeform function or just give it the command to close? Thanks
  4. Hello, Let's take a simple example to illustrate my case. I open a webpage with the command _IECreate and I parse all its elements : #include <IE.au3> $oIE = _IECreate("http://www.york.ac.uk/teaching/cws/wws/webpage1.html") $oElements = _IETagNameAllGetCollection($oIE) For $oElement In $oElements ConsoleWrite("Tagname: " & $oElement.tagname & @CRLF & "Id: " & $oElement.id & @CRLF & "InnerText: " & $oElement.innerText & @CRLF & "--------------------------------" & @CRLF) Next Now let's imagine I simulate a click with MouseClick to the link "lesson two" at the bottom of this webpage. A new webpage will open : http://www.york.ac.uk/teaching/cws/wws/webpage2.html I'd like to get the elements (tagname, id, innertext) of this new webpage, just like I got them for the first webpage. But for this, I presume I would have to get a new $oIE2 Object variable of an InternetExplorer.Application, in order to be able to use the _IETagNameAllGetCollection once again. How am I supposed to do this ? Thank you !
  5. Hi, I'm using the IE.au3 library to parse elements in a webpage and get their (x,y) coordinates. Main commands I'm using are : $oIE = _IECreate($myWebPage) $oElements = _IETagNameGetCollection($oIE, "label") $windowleft = $oIE.document.parentwindow.screenLeft $windowtop = $oIE.document.parentwindow.screenTop $oElementPosX = $windowleft + _IEfindPosX($oElement) $oElementPosY = $windowtop + _IEfindPosY($oElement) Now things become a bit tricky when i simulate a scroll in my webpage : $oIE.document.parentwindow.scroll(0, $myScrollY) Because once this is done, the coordinates of the elements are still what they were before the scroll. I can manage this problem by keeping track of the number of pixels I have scrolled, and compute the new "real" ($oElementPosX, $oElementPosY). But I'm pretty sure there's a more efficient / more elegant way to do it. What's more in some situations, when I click some controls in the webpage, the webpage adds new elements and shifts the controls below by a random number of pixel, so my workaround can't be used... So here's my question : Is there a way to "refresh" the calculation of label coordinates ($oElementPosX, $oElementPosY) after a scroll ? Thank you ! EDIT : I forgot to post the _IEfindPosX and _IEfindPosY functions (found somewhere on this forum) : Func _IEfindPosX($o_object) Local $curleft = 0 Local $parent = $o_object If IsObj($parent) Then While IsObj($parent) $curleft += $parent.offsetLeft $parent = $parent.offsetParent WEnd Else Local $objx = $o_object.x If IsObj($objx) Then $curleft += $objx EndIf Return $curleft EndFunc Func _IEfindPosY($o_object) Local $curtop = 0 Local $parent = $o_object If IsObj($parent) Then While IsObj($parent) $curtop += $parent.offsetTop $parent = $parent.offsetParent WEnd Else Local $objy = $o_object.y If IsObj($objy) Then $curtop += $objy EndIf Return $curtop EndFunc
  6. Hello, I'm trying to save source of a particular webpage using its URL. When i tried to save source code using following command it works fine $IE = _IECreate( 'www.example.com', 0, 0 ) But my problem is different I've saved different URL in my excel sheet, that's why, I tried to use "$IE" command in this way; $URL = _Excel_RangeCopyPaste($oWorkbook1.Activesheet, "C1") $IE = _IECreate($URL, 0, 0 ) But It's unable to fetch source codes using URL placed in excel sheet 1 at cell No. "C1". Please guide me what's wrong with my codes and how can I make it possible to use URL placed in excel sheet instead of copying URL every time in "_IECreate" command. Thanks #RequireAdmin #include <Excel.au3> #include <IE.au3> #include <String.au3> #include <Array.au3> Local $oExcel = _Excel_Open() Local $oWorkbook1 = _Excel_BookOpen($oExcel, @ScriptDir & "\Software.csv", True) $file = fileopen(@scriptdir & "\source01.txt", 10) ;------------Below Command is not working--------------------- $URL = _Excel_RangeCopyPaste($oWorkbook1.Activesheet, "C1" ;------------String $IE unable to fetch data from URL available in excel sheet at cell No. "C1"--------------------- $IE = _IECreate($URL, 0, 0 ) $source = _IEDocReadHTML($IE) FileWrite($file, $source)
  7. My program is super simple with only 2 lines of code. #include <IE.au3> $Site = _IECreate("www.google.com", 0, 1, 1) I'm just trying to open up a browser that goes to google.com The issue with this is that whenever I try and run the program, I get this error Not sure how to go about fixing this issue?
  8. #include <IE.au3> _IECreate("www.google.com") Sleep(5000) WinSetState("Google - Internet Explorer","",@SW_MAXIMIZE)The browser window opens and it goes to google.com but it will not maximize. I have also tried: #include <IE.au3> Local $Browser = _IECreate("www.google.com") Sleep(5000) WinSetState($Browser,"",@SW_MAXIMIZE)Also doesn't work. I'm running windows 8.1 x64 and internet explorer 11.0.9600.16384. Help!
  9. Hi all Im still New To Autoit and would realy like some help ... I have gone through some examples and other code on the forum but now I am stuck see comments on what I want to do . #RequireAdmin #include <IE.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <String.au3> #include <Array.au3> Global $oIE = _IECreate("https://www.harryhomers.org/et/forum/viewtopic.php?f=89&t=4309", 0, 0, 1, 0) Global $oElements = _IETagNameAllGetCollection($oIE) Global $oID = _IEGetObjById($oIE, "p41827") Global $ListArray[1] #cs ; the list I want to get is 1 - 20 max 30 and there names . The DIV ID is p41827 <div class="content">HarryHomers can be found at 85.236.100.205:<span style="font-weight: bold">27960</span><br /><br /><ul>HH Bot Multi campaign **<br /><br />1. NAME 1<br />2. NAME 2<br />3. NAME 3<br />4. NAME 4<br /> 5. NAME 5<br />6. NAME 6<br />7. NAME 7<br />8. NAME 8<br />9. NAME 9<br />10. NAME 10<br />11. NAME 11<br />12. NAME 12<br />13. NAME 13<br />14. NAME 14<br /> 15. NAME 15<br />16. NAME 16<br />17. NAME 17<br />18. NAME 18<br />19. NAME 19<br />20. NAME 20<br /> </ul> #ce For $oElement in $oElements Local $_sSourceTAG = $oElement.tagname Local $_sSourceTEXT = $oElement.innerText Local $_sSourceID = $oElement.id Local $_sSourceHTML = $oElement.innerhtml If $_sSourceID = "p41827" Then ;Test message box MsgBox($MB_SYSTEMMODAL, "MY TAG ID", "Innertext: " & $_sSourceTAG & @CRLF & "id: " & $_sSourceID & @CRLF & "innerText: " & $_sSourceTEXT) MsgBox($MB_SYSTEMMODAL, "MY HTML", "Innerhtml: " & "id: " & $_sSourceID & $_sSourceHTML) $oData = _IEPropertyGet($oIE, "strong") $Check = StringRight($oData, 11) If $Check = "ohnDory</A>" Then ;Test message box MsgBox($MB_SYSTEMMODAL, "SEARCH FOUND", "The characters are: " & $Check ) $ArraySplit1 = StringSplit($oData, ".") For $ArrayItem in $ArraySplit1 $ArrayItem = StringSplit($ArrayItem, "<BR>", 1) If $ArrayItem[0] > 1 Then If $ArrayItem[2] > 0 Then $ArrayItem[1] = StringStripWS($ArrayItem[1], 3) _ArrayAdd($ListArray, $ArrayItem[1]) EndIf EndIf If StringInStr($ArrayItem[1], "</UL>") Then $POS = StringInStr($ArrayItem[1], "</UL>") - 1 $String = StringLeft($ArrayItem[1], $POS) $String = StringStripWS($String, 3) _ArrayAdd($ListArray, $String) EndIf Next Else ; Not correct so ignore MsgBox($MB_SYSTEMMODAL, "NOT FOUND", "The characters are: " & $Check ) EndIf EndIf Next _ArrayDisplay($ListArray) _ArrayReverse($ListArray) _ArrayPop($ListArray) _ArrayReverse($ListArray) _ArrayDisplay($ListArray, "Map List Array Final View") sleep(2500) _IEQuit($oIE) #cs ; note the html (map names) does change once a month ; save txt file #ce ;_FileWriteLog(@TempDir & "\list.txt", $ListArray)
  10. Could someone help me understand why I'm losing the object for certain _IE user-functions (those included with Au3 v3.3.10.2) #include <IE.au3> ; Required for automatically entering login credentials to app manager GLOBAL $oIE $oIE = _IECreate("about:blank", 1) ; _IEQuit ($oIE) ; _IEQuit line HERE, it work, closing the browser... ConsoleWrite ("===============================" & @CRLF ) If WinExists ( "Blank Page - Windows Internet Explorer") <> 1 then While WinExists ("Blank Page - Windows Internet Explorer") <> 1 sleep ( 500 ) WEnd EndIf sleep ( 1200 ) ConsoleWrite ("===============================" & @CRLF ) ; _IEQuit ($oIE) ; _IEQuit line HERE, it work, closing the browser... ConsoleWrite ('This is where the object, $oIE, gets broken/lost' & @CRLF ) _IENavigate( $oIE, "http://www.msn.com" ) sleep (3000) ConsoleWrite ("===============================" & @CRLF ) sleep ( 5000 ) _IEQuit ($oIE) ; HERE FAILS, console error: "--> IE.au3 T3.0-1 Error from function _IEQuit, $_IEStatus_InvalidObjectType" exit In the above script, there are 3 lines with _IEQuit. The 1st 2 are commented out, but they work with closing the browser fine, but the 3rd line, fails to close out the browser window. (I'm not wanting to close out the browser window, but I was trying to figure out why subsequent calls lose the object variable reference of $oIE. Using _IEQuit seemed to be the easiest way to ensure we were attached to the same browser window. I've also noticed that using the above script, after the script exits (with the 3rd _IEQuit line intact), since the browser window is still open, if I try and enter any URL into the adress bar, pressing enter then causing a new browser window to open up. Any suggestions on why the object reference is getting broken? Thanks, Van
  11. Hi to all! I'm using an Internet Explorer 9 virtualized and not the Internet Explorer 9 that is installed. My question is: Can I configure _IECreate function to run that IE9 virtualized and not the installed one? Thanks to all
  12. When I try simple code like #include <IE.au3> $oIE = _IECreate("http://sourceforge.net", 0, 0) It fails to hide. Any ideas?
×
×
  • Create New...