Sign in to follow this  
Followers 0
Herb191

Having problems with IE functions and Windows 7

10 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Windows 7 64 bit and IE9 ? Posted Image

-Support-

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Windows 7 64 bit and IE9 ? Posted Image

-Support-

Yes that is correct.

Share this post


Link to post
Share on other sites

Yes that is correct.

Try IE8 compatibility Mode.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

No luck with compatibility view. :unsure:

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Bump…

Anyone else have a possible solution?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks Dale,

Downgrading to IE 8 fixed the problem.

Share this post


Link to post
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
Sign in to follow this  
Followers 0