Jump to content
Sign in to follow this  
Syrin

Need some help with Internet Explorer COM

Recommended Posts

Syrin

I'm just asking here in case somebody has experience with the IE9 COM. For some reason, I can't do certain things (such as the .click() or .focus() methods on any elements), and I couldn't find any information about what might be stopping me from doing so. Here's a quick example that shows what I mean.

#include <IE.au3>
$oIE = _IECreate("http://www.google.ca/")
_IELoadWait($oIE)
local $t = _IEGetObjByName($oIE,"q")
;This works, properties seem to work fine.
$t.value = "Test 1"
;This also works, so it isn't a problem with methods.
$t.insertAdjacentText("afterBegin","Test 2")
$t = _IEGetObjByName($oIE,"btnG")
;This does nothing.
$t.click()

I've also tried it without IE.au3 functions, just using normal COM syntax according to documentation on the MSDN library, no luck. I've also tried it with LuaCOM, so I don't think it's a problem with AutoIT, but with IE9.

Edited by Syrin

Share this post


Link to post
Share on other sites
Richard Robertson

I'm sure you need some kind of security clearance. Microsoft knows that automating IE can produce dangerous results.

Share this post


Link to post
Share on other sites
Syrin

Ugh. I can do it manually - I have a version set up that just uses the MouseClick() AutoIt function... I just prefer elegant solutions to hamfisted hackeries. Oh well. If it works, it works, I guess.

Share this post


Link to post
Share on other sites
Richard Robertson

Have you tried running your script as administrator to see if it works that way?

Share this post


Link to post
Share on other sites
Syrin

I have, it was one of the first things I tried. No dice.

Share this post


Link to post
Share on other sites
Richard Robertson

Do you have a prerelease copy of IE9? I could see that causing problems I guess.

Share this post


Link to post
Share on other sites
Syrin

Nope, I only just downloaded it a couple days ago. Should be release version.

Share this post


Link to post
Share on other sites
Richard Robertson

I'm remembering someone encountering this but searching for IE9 COM isn't returning significant documents. Unfortunately COM is a top level domain.

Share this post


Link to post
Share on other sites
Syrin

Yeah... a google for "IE9 COM" doesn't help so much. Oh well, the deadline is upon me, so I just have to leave it running using MouseClick instead. Thanks for the help.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.