Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Press a button with CInternetSession (IE 6)

    I have a C++ program which retrieves the source of a page via cInternetSession::CInternetFile, etc. On the retrieved page is a button (implemented with JavaScript) wich starts a file download. How can I programmatically press this button so that I can get the file? TIA --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Press a button with CInternetSession (IE 6)

    Sorry, I don't know anything about that particular interface. Can you extract the URL from the page and retrieve the file that way? If it's a form, can you "submit" the form?

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Press a button with CInternetSession (IE 6)

    As you suggest, I currently construct the URL for the pages leading up to this one, but cannot figure out the URL from the page source with the button. When you manually press the button, it starts a file download with "smoke and mirrors." (ie JavaScript that I can't see)
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Press a button with CInternetSession (IE 6)

    If there is a way to submit javascript to the page, this kind of syntax works in java script:ButtonName.click();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •