简体   繁体   中英

Automate Javascript form in Internet Explorer with VBA

I have a question similar to this one:

Automating Java Applet from IE and VBA

which has no answer, as of yet.

I'm trying to automate filling in the form on the front page of degreedays.net .

I'm using VBA so I can integrate my automation/scraping with excel easily.

I think the relevant source code of the page is:

<h2 class="popout">Degree Days.net</h2>
    <div id="formSlot">
        <div class="formLoading">
            <script type="text/javascript">
            // <![CDATA[
            document.write('<p><img src="template/loading-small.gif" width="16" height="16"/><span class="loadingText">Loading...</span></p>');
            // ]]>
            </script>
            <noscript>
            <p class="noJavaScript">To use Degree Days.net, your browser must have JavaScript enabled.  This should only require a very simple change to your browser settings.</p>
            </noscript>
        </div>
    </div>

But I have no way of using the typical VBA for forms, for example:

    ie.document.getElementById("   ").value= "   "

as there are no <input> or <option> tags visible to me.

How would I go about doing this? Any ideas would be appreciated.

I work for the company that runs Degree Days.net .

In case you haven't noticed, we have an API here . Programming something to fetch data out of the API is going to be a lot easier and more reliable than trying to scrape data out of the website.

We also have a desktop app that enables you to specify a big list of locations and then get the app to download it all for you, into a spreadsheet, using the API. No programming required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM