title: Using Excel VBA to select onchange value in JavaScript web
body: <p>I am very new to VBA, I've been tried many times to use Excel VBA to select the value on a website, but it doesn't work. Below is the code I use. </p>
  
  <p>Actually I don't know how to get the elements since it has no "id" or "name" tag.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Sub GetFinanceData()
  
  Dim URL As String
  
  URL = "http://stock.finance.sina.com.cn/hkstock/finance/00001.html"
  
  Set myIE = CreateObject("InternetExplorer.Application")
  
  With myIE
  .navigate URL
  .Visible = True
  
  Do While .Busy = True Or .readyState &lt;&gt; 4
  Loop
  DoEvents
  
  .Document.parentWindow.execScript "selectData(zero);", "JavaScript"
  
  End With
  
  End Sub</code></pre>
  </div>
  </div>
  </p>
  
  <p>Below is the HTML code, I want to change the option value to "zero" when open the website, can anybody help to check and advise what VBA code I can use to get the value "zero"? Thanks a lot in advance!</p>
  
  <p><img src="https://i.stack.imgur.com/i064h.png" alt="enter image description here"></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;a name="a1" id="a1"&gt;&lt;/a&gt;
     &lt;div class="part02"&gt;
        &lt;div class="sub01"&gt;
            &lt;div class="sub01_tt fblue"&gt;
                &lt;span class=" selected"&gt;&lt;a href="#a1" target="_self"&gt;重要财务指标&lt;/a&gt;&lt;/span&gt;
                &lt;span class=""&gt;&lt;a href="#a2" target="_self"&gt;资产负债表&lt;/a&gt;&lt;/span&gt;
                &lt;span class=""&gt;&lt;a href="#a3" target="_self"&gt;现金流量表&lt;/a&gt;&lt;/span&gt;
                &lt;span class=""&gt;&lt;a href="#a4" target="_self"&gt;综合损益表&lt;/a&gt;&lt;/span&gt;
                &lt;em class="rt"&gt;报表类型:&lt;select class="fgrey" style="width:100px;" interface="getFinanceStandardForjs?symbol=$symbol&amp;financeStanderd=" table="tableGetFinanceStandard" onchange="selectData(this);"&gt;
                  &lt;option value="all" &gt;全部&lt;/option&gt;
                  &lt;option value="zero" &gt;年报&lt;/option&gt;
                  &lt;option value="1" &gt;中报&lt;/option&gt;
                  &lt;option value="2" &gt;一季报&lt;/option&gt;
                  &lt;option value="3" &gt;三季报&lt;/option&gt;
              &lt;/select&gt;&lt;/em&gt;
          &lt;/div&gt;
          &lt;div class="sub01_cc"&gt;
               &lt;div class="sub01_c"&gt;
                                &lt;table cellspacing="0" cellpadding="0" border="0"  class="tab05"&gt;
                      &lt;tbody id="tableGetFinanceStandard"&gt;
                       &lt;tr&gt;</code></pre>
  </div>
  </div>
  </p>