Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8337701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:22:31+00:00 2026-06-09T04:22:31+00:00

I’ve been doing Google detective work for a few hours (including searching StackOverflow) for

  • 0

I’ve been doing Google detective work for a few hours (including searching StackOverflow) for a technique to allow targeting of HTML elements produced by JavaScript in VBA.

As an example, I cannot use ie.Document.getElementById(id) on this: http://www.kisfutures.com/electronic.html?page=quote&sym=NGU12&mode=i

However, that method is quite capable of finding elements on static pages, as tested on google.com.

I’ve played with simply getting all the InnerText from Document.body and then parsing the file for my desired TD values, but I ran into a roadblock when trying to split two values that are on different lines. As an illustration, the following was understood by Split(..) as “2040”:

20
40

From what I understand, the problem with getElementById(id) is that the website’s table is generated by JavaScript after the page has loaded, and thus any elements created by that JavaScript cannot be targeted by my VBA code. Is there anyway to have my VBA code see this JavaScript-generated content?

Thank you for your help!

Edit

The VBA code being used:

Function Quote(Market, Parameter)
    Set ie = CreateObject("InternetExplorer.Application")
    ie.Navigate "http://www.kisfutures.com/electronic.html?page=quote&sym=NGU12&mode=i"
    While ie.Busy
        DoEvents
    Wend
    Dim id As String
    id = "dt1_" & Market & "_" & StrConv(Parameter, vbLowerCase)
    Quote = ie.Document.getElementByID(id).InnerText
    ie.Quit
End Function

Basically I try to build an HTML element ID using the column header for the Market. So if, for example the market is “NGU12” and the column header is “Open”, the ID built is: “dt1_NGU12_open”, which is the ID for the TD element containing the “Open” value for market NGU12.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:22:33+00:00Added an answer on June 9, 2026 at 4:22 am

    As Tim has mentioned there should be no difference between statically and dynamically generated content when attempting access. Try this:

    Function Quote(Market, Parameter)
        Set ie = CreateObject("InternetExplorer.Application")
        ie.Navigate "http://www.kisfutures.com/electronic.html?page=quote&sym=NGU12&mode=i"
        While ie.Busy
            DoEvents
        Wend
        Application.Wait Now + TimeSerial(0,0,1) 'Pause 1 second, hopefully
                                                 'the dynamic content is 
                                                 'generated within this 
                                                 'time-frame
        Dim id As String
        id = "dt1_" & Market & "_" & StrConv(Parameter, vbLowerCase)
        Quote = ie.Document.getElementByID(id).InnerText
        ie.Quit
    End Function 
    

    There are better ways of halting execution (see Windows Sleep API) but I’ll leave that to you if you need more fine-grained control.

    Also, if you’d like to test whether a specific id exists after the page has been generated you could load the page manually in IE and add a bookmarklet containing the following as the URL:

    javascript:void((function() {var a = document.getElementById(prompt('Please enter an id to test','dt1_NGU12_open')); if (a) {alert('Element found');} else {alert('Element not found')};})())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.