title: Would like to extract text from a website with excel vba
body: <p>i current have the following code which is not working giving me a object variable or with block variable not set.</p>
  
  <pre><code>Set doc = IE.document
  Dim sDD4 As String
  sDD4 = Trim(doc.getElementById("productInfoContainter").getElementsByTagName("span")(0).innerText)
  Sheet1.Cells(i, 8) = sDD4
  </code></pre>
  
  <p>the html im trying to extract from looks like this:</p>
  
  <pre><code>&lt;div id="productInfoContainter" style="display: block;"&gt;
  &lt;table width="100%" style="display: none;" border="0" cellspacing="0" cellpadding="0"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td valign="top"&gt;
                  &lt;div style="margin: 5px;"&gt; 
                      &lt;span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;
                          &lt;span class="google-src-text" style="text-align: left; direction: ltr;"&gt;
                              &lt;b&gt;text i need 1&lt;/b&gt;
                          &lt;/span&gt; 
                              &lt;b&gt;text i need 2&lt;/b&gt;
                      &lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td valign="top"&gt;
                  &lt;div style="margin: 10px 10px 20px;" itemprop="description"&gt;&lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>i have also tried getElementbyClassName("google-src-text")(0).innerText</p>
  
  <p>comes up with the same error.</p>
  
  <p>basically i am trying to translate a website in google translate the take out a body of the translated text</p>
  
  <p>any help appreciated</p>