+ Reply to Thread
Results 1 to 2 of 2

Internet Explorer Automation from Excel and the ReadyState propert

  1. #1
    rMartyr
    Guest

    Internet Explorer Automation from Excel and the ReadyState propert

    After getting the automation tips for how to manipulate IE from Excel from
    here and *****-blog, I've run into a bit of a snag that I hope is just based
    on my lack of comprehension.

    I'm using this loop to wait for the page to be ready as I saw in some
    examples:

    Do
    DoEvents
    tSystem.Sleep 0.8 ' I put this in to try to troubleshoot since delays seem
    to help...
    Loop Until IeApp.ReadyState = READYSTATE_COMPLETE


    The ReadyState property doesn't seem to mean the same thing as I'd hoped.
    Sometimes page can be done loading, ReadyState = 4, but not actually ready
    for input. In this case when the keystrokes come, they just impact on the
    surface of a busy page and are lost from the sequence.


    Am I missing a ReadyState subtlety about frames, forms or scripts on a page?
    Can anyone advise me on a better property to wait for if what I really want
    is to know whether a keystroke or mouseclick will be accepted on a form in a
    frame in IE?

    Thank you for your attention,
    Ryan


  2. #2

    Re: Internet Explorer Automation from Excel and the ReadyState propert

    If you know VB.NET or C# you can try SW Explorer Automation
    (SWEA) (tp://home.comcast.net/~furmana/SWIEAutomation.htm) The SWEA
    makes IE automation very simple. SWEA supports frames, dialog boxes
    (alerts), html dialog boxes.


    The following example shows how to get a table from the
    http://newsite.tab.co.nz/racing/ Web site using SWEA. SWEAProject.htp
    was created by SWEA Visual Designer. SWEA designer contains Visual
    Table Extractor. The Table Data Extractor extracts tabular data from
    the Web pages. If a Web page contains repeating information patterns
    than the data can be transformed into ADO.NET DataTable object.


    public static void Main() {
    SWExplorerAutomation.Client.ExplorerManager explorerManager = new
    SWExplorerAutomation.Client.ExplorerManager();
    SWExplorerAutomation.Client.Scene scene;
    explorerManager.Connect(-1);
    explorerManager.LoadProject("SWEAProject.htp");
    explorerManager.Navigate("http://newsite.tab.co.nz/racing/");
    scene = explorerManager["Scene_0"];
    scene.WaitForActive(30000);
    System.Data.DataTable dataTable;
    dataTable =
    ((HtmlContent)(scene["HtmlContent_0"])).TableDataExtractor.DataTable;
    explorerManager.DisconnectAndClose();
    }


    The DataTable can be stored into text file (CSV) and loaded by Excel or

    Excel application can be called directly from the scraping program.



    rMartyr wrote:
    > After getting the automation tips for how to manipulate IE from Excel from
    > here and *****-blog, I've run into a bit of a snag that I hope is just based
    > on my lack of comprehension.
    >
    > I'm using this loop to wait for the page to be ready as I saw in some
    > examples:
    >
    > Do
    > DoEvents
    > tSystem.Sleep 0.8 ' I put this in to try to troubleshoot since delays seem
    > to help...
    > Loop Until IeApp.ReadyState = READYSTATE_COMPLETE
    >
    >
    > The ReadyState property doesn't seem to mean the same thing as I'd hoped.
    > Sometimes page can be done loading, ReadyState = 4, but not actually ready
    > for input. In this case when the keystrokes come, they just impact on the
    > surface of a busy page and are lost from the sequence.
    >
    >
    > Am I missing a ReadyState subtlety about frames, forms or scripts on a page?
    > Can anyone advise me on a better property to wait for if what I really want
    > is to know whether a keystroke or mouseclick will be accepted on a form in a
    > frame in IE?
    >
    > Thank you for your attention,
    > Ryan



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1