Jump to content

Having problems with IE functions and Windows 7


Recommended Posts

This function runs fine on one computer running XP and just returns a an empty array when I run it on a computer running windows 7 64 bit. Does anyone have any ideas on why and how I can make it work? I am guessing it’s a security issue with IE but I assumed that if I used #RequireAdmin it would work fine. Apparently not! lol

#RequireAdmin
#include <IE.au3>
#include <Array.au3>

$links = google_seach("test")
_ArrayDisplay($links)

Func google_seach($kw_to_search_for)
Dim $array_of_links[1]
    ConsoleWrite(" Waiting for Google to load..." & @CRLF)

    $oIE = _IECreate("http://www.google.com", 0, 1)

    ConsoleWrite("Submiting Google seach for " & '"' & $kw_to_search_for & '"' & @CRLF)
    $oForm = _IEFormGetObjByName($oIE, "f")

    $oQuery = _IEFormElementGetObjByName($oForm, "q")

    _IEFormElementSetValue($oQuery, $kw_to_search_for) ;enters the KW's that will be searched

    _IEFormSubmit($oForm)

    $oLinks = _IELinkGetCollection($oIE)

    If IsObj($oLinks) Then ;will attempt to run if $oLinks is an obj
        For $oLink In $oLinks
            $sLinkText = _IEPropertyGet($oLink, "innerText")
            _arrayadd($array_of_links, $sLinkText)
            ConsoleWrite($sLinkText & @CRLF)
        Next
    EndIf
    Return $array_of_links
EndFunc
Link to comment
Share on other sites

Ok well its not a Windows 64 bit thing I just got done installing Windows 7 32 bit on the same computer and I have the same problem. I have the exact same version installed on another computer and it works fine. The only deference is that the computer that it is not working on is installed on a clients computer in the UK. I would think that IE and Google would work the same there though...

Edited by Herb191
Link to comment
Share on other sites

I'm afraid there is a problem with AutoIt and IE9. The ObjName function is returning null for some objects instead of the object type. IE.au3 makes extensive use of ObjName. A bug report has been filed, but I don't believe there has been any work on it. One person has reporterd luck with putting the page in compatability mode.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...