+ Reply to Thread
Results 1 to 6 of 6

getting the right input box in a complex IE document

Hybrid View

Drio getting the right input box... 01-19-2012, 09:05 AM
Chippy Re: getting the right input... 01-19-2012, 01:30 PM
Drio Re: getting the right input... 01-20-2012, 10:14 AM
Kyle123 Re: getting the right input... 01-19-2012, 01:41 PM
Drio Re: getting the right input... 01-20-2012, 10:20 AM
Kyle123 Re: getting the right input... 01-23-2012, 10:34 AM
  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    getting the right input box in a complex IE document

    Hi

    Just trying to fill the field GMC Reference Number on following site from Excel 2003 to IE8
    http://webcache.gmc-uk.org/gmclrmp_enu/start.swe

    and I'm stranded

    Set objDoc = IE.document.body.Children.Item(0)
    gives me the right frame according to a DOM browser addin in Firefox.
    but I cannot seem to reach beyond that

    The DOM structure is like this (each indented space is one level in the tree
    #document
    1st HTML
    1st FRAMESET
    1st FRAME
    1st #document
    1st HTML
    1st FRAMESET
    2nd FRAME
    1st #document
    1st HTML
    1st BODY
    2nd TABLE
    1st TBODY
    2nd TR
    1st TD
    1st FORM
    2nd TABLE
    1st TBODY
    1st TR
    1st TD
    1st LI
    LABEL
    2nd TD
    NOBR
    INPUT


    The INPUT has name="s_3_1_2_0" and id="gmcrefnumber"

    Any clues would be welcome

    Many thanks

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: getting the right input box in a complex IE document

    2nd frame within the 1st frame, therefore in one line:
    IE.document.frames(0).document.frames(1).document.getElementById("gmcrefnumber").Value = "1234"
    But rather than doing it in one statement, I suggest you set a reference to the very inner document shown above so that you can easily fill in all the form fields

  3. #3
    Registered User
    Join Date
    01-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: getting the right input box in a complex IE document

    Many Thanks Chippy, this does the trick

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: getting the right input box in a complex IE document

    You would probably be better off posting the data directly to the server so you don't need to automate IE, automating ie is very slow.

    You can then extract the following page data directly assuming this is what you are trying to do

    Do you have a valid GMC ref no?

  5. #5
    Registered User
    Join Date
    01-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: getting the right input box in a complex IE document

    Kyle123, I get your point, but don't see how I can post direct to the server as it's not mine
    If I could link the server I would just use T-SQL to pull it into the DB where i need it for verification
    If you search for surname 'a*' (wh the quotes) it'll come up with a subset of some valid numbers of surnames starting with a after a while.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: getting the right input box in a complex IE document

    Hi Drio

    Generally you can POST to any server, in this case it would be tricky however due to the sn it assigns to each request.

    For a very simple example, have a look here, it's usually much faster than trying to automate Internet Explorer.

    For more complex scenarios/more control you can use the MSXML library for which you can set the headers explicitly and parse the results

+ 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