Automating Internet Explorer

Discussion in 'Javascript' started by tinkerman, Jun 19, 2005.

  1. tinkerman

    tinkerman Guest

    Hello net friends,

    I need to automate Internet Explorer in a very simple way.
    I need to:

    1. press refresh (F5) on the currently loaded website.
    2. press END button.
    3. Click a button somewhere on the screen with the mouse left button
    (I'm not sure this button can be pressed directly via keysequence, not
    via mouse, but it does have a name).
    4. wait for a few seconds.
    5. loop back to step 1.

    I have managed to do the above with a windows macro tool, but my main
    problem is that the macro only runs in the forground, thus negating
    any other use of my PC while it is running (and it's supposed to run
    indefinitely).
    Since Internet explorer CAN run in the background, and since it can
    run various script languages, I was wondering if such can be written
    that will also run in the background and do what I want.

    I've read about this on MicroSoft's webpage and it seems doable (e.g.
    sending keystrokes to IE), but I understand that I might need to write
    a HTML file which will open IE and then interact with it (because IE
    cannot run a script file directly, i.e. if it's not embedded in a HTML
    file).
    I don't want to open a new IE window because the site I want to
    interact with uses cookies for session information and I will be
    forced to login which is a bit more complex.

    Since I'm no internet programmer (although I do have programming
    experience), and learning it all is no quick project, I was looking
    for someone
    with experience that could show me how to do it as simply and swiftly
    as
    possible, such as providing the few required lines of code and
    the method to run them in IE (either directly or via an intermideate
    HTML file).

    Any help will be greatly appreceated.

    thanks, TM
     
    tinkerman, Jun 19, 2005
    #1
    1. Advertisements

  2. Consider using an HTML Application that embeds the web site in an
    iframe and scripts the behavior you want.

    What is this poor web site that needs to be reloaded every few
    seconds? You're not trying to increase the hit count of web
    advertising, are you?
    /L
     
    Lasse Reichstein Nielsen, Jun 19, 2005
    #2
    1. Advertisements

  3. tinkerman

    Jim Ley Guest

    Sounds like it might be a screen capturing system?

    http://iecapt.sourceforge.net/

    might be a better combination, combined with an IFRAME system if you
    need something more complicated maybe.

    Jim.
     
    Jim Ley, Jun 19, 2005
    #3
  4. tinkerman

    tinkerman Guest

    No, don't worry, I'm not trying to cheat web advertising (but smart
    thinking from your side...)
    Actually, I want to capture snapshots of a web page every minute or
    so, and sometimes press a button to submit something.
    I was thinking along the lines you suggested, and even saw some
    Javascript programs (real simple and easy to use, just click them in
    windows explorer and they run) but don't know how to build an iFrame
    and such.
    As I said, I'm no real Javascript programmer, and don't have the time
    to learn the development environement. Just need the few lines of code
    to do it and how to run it...:
    1. Load the web page.
    2. Login.
    3. Refresh page.
    4. Go to end of page.
    5. Press a button at a fixed place in the page (maybe it can be
    "pressed virtually" using it's name instead of actually with a mouse).
    6. Add some delay (time of day dependent, 30sec-3minutes)
    7. Loop to 3.

    If I can run the script inside a currently open and login'ed page,
    then steps 1-2 are unnecessary.
    As I said, I've got it running great with a macro, I don't have this
    macro installed on all systems I want, or can.

    Thanks for your support.
    cheers, TM
     
    tinkerman, Jun 20, 2005
    #4
  5. tinkerman

    James X. Li Guest

    You can do these kind of automation easily with wsh on Windows.
    Take a look into IeUnit at http://ieunit.sourceforge.net. The smart
    bookmark feature might be something for you.

    James X. Li
     
    James X. Li, Jun 20, 2005
    #5
  6. tinkerman

    Csaba Gabor Guest

    You can do this with VBScript. That is, you can write a .vbs file in
    vbscript that will do all you want. However, you may need to learn a
    bit of javascript as it relates to accessing the DOM (document object
    model) of the site that you are interested in.

    Anyway, search google groups for the following to get plenty of
    examples:
    vbscript automate ie group:*.vbscript.*

    Csaba Gabor from Vienna
    PS. And use .refresh to refresh IE
     
    Csaba Gabor, Jun 20, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.