Jump to content

Sending keystrokes to a hidden IE window?


Recommended Posts

Hi,

I ma trying to use AutoIt to download web pages in the background, so I have included IE.au3 and am using _IECreate($URL, 0,0,1,1) where $URL contains the url of the site.

Once the page has loaded (the command waits for the page to load via the 1st 1), I send keystrokes to the application to save the page to the desired location.

This all works fine if I change the 2nd 0 to a 1, but when the window is hidden it does not seem possible to use Send to send keystrokes.

Ideally I would like the window hidden so this all happens in hte background, is there a way of doing this (with or without Send)?

Incidentally I have tried using InetGet, but the page has active content, so needs to load in a browser.

Any suggestions?

Link to comment
Share on other sites

  • Developers

Once the page has loaded (the command waits for the page to load via the 1st 1), I send keystrokes to the application to save the page to the desired location.

Why do you need to use send to send keystrokes?

Don't the _IEXXXX() functions give what you need?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Why do you need to use send to send keystrokes?

Don't the _IEXXXX() functions give what you need?

Jos

Nothing that I've found, I am wanting to save the page as a text file, so the keystrokes send Ctrl+s the path/filename, TAB and t to make it a text file. I have looked through IE.au3, and can't find anything that does that - it does clicking on links and filling in forms but I can't see how to control the application itself.

The _IECreate statement returns an object variable, but I don't know if there is something similar to Send() that would send the keystrokes to a specified application using the object variable - if that makes sense!

Alternatively I will look into launching IE in a very small window and use send the normal way... now, how to specify the window size...

One problem or another!

Link to comment
Share on other sites

It would be easier like this:

<snip>

That looks like it will work - I'll have to do some testing, but it does look like it allows the page to load before reading the HTML, I have tried it with the IE window hidden and it still works, so just need to test it on the site in question (needs to be in business hours, so I'll let you know).

I looked at _IEDocReadHTML, but I thought it was just an equivalent to InetGet. Thanks for pointing me this way!

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...