title: How do I parse a <HTML> as a string in Google App Script?
body: <p>I want to know if it is possible to parse a  string in Google App Script.</p>
  
  <p>Here is my problem:</p>
  
  <p>If I type the following code in Google App Script Editor:</p>
  
  <pre><code>function test() {
  
    var response = UrlFetchApp.fetch("http://www.pudim.com.br/");
   Logger.log(response.getContentText());
  
  }
  </code></pre>
  
  <p>I will get in the Log the Page´s HTML, as you can see:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" href="/SiteBuilder/css/Pessoal03Palha.css" type="text/css" /&gt;
      &lt;meta name="Keywords" content="" /&gt;
      &lt;meta name="Description" content="" /&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="SiteBuilder_Principal"&gt;
          &lt;div id="SiteBuilder_Topo" style="background-image: url('/SiteBuilder/UploadUsers/pudim.com.br/634607701572677834.png');"&gt;
              &lt;div id="SiteBuilder_Topo_Objeto"&gt;
  
              &lt;/div&gt;
              &lt;div id="SiteBuilder_Topo_Frente"&gt;&lt;/div&gt;
              &lt;div id="SiteBuilder_Logo" style="top:54px; left:70px;;"&gt;
                  &lt;img src="/SiteBuilder/UploadUsers/pudim.com.br/634607755224560419.jpg" border="0" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="SiteBuilder_Menu"&gt;
              &lt;div id="SiteBuilder_Menu_Area"&gt;
                  &lt;style&gt;
        .dv_position{float:left; padding-right:12px; font-family: Arial; font-size: 10px; color: White; font-weight: bold;}
      &lt;/style&gt;&lt;div class="dv_position"&gt;&lt;table&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;img src="/SiteBuilder/Templates/Pessoal03/Pessoal03Palha/imagens/tc_contrutor_template03_pessoal_palha_icon.gif"&gt;&lt;/img&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="index.html"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;table id="SiteBuilder_TbConteudo" cellpadding="0" cellspacing="0" border="0"&gt;
              &lt;tr&gt;
                  &lt;td align="left" valign="top"&gt;
                      &lt;div id="SiteBuilder_Conteudo"&gt;
                          &lt;div style="text-align: center;"&gt;&lt;img alt="" src="/SiteBuilder/UploadUsers/pudim.com.br/pudim.jpg" style="border-width: 0px; border-style: solid;" /&gt;&lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;div id="SiteBuilder_Rodape"&gt;
              &lt;div id="div_RodapeViewMode" class="div_RodapeViewMode"&gt;
                  &lt;a href="mailto:pudim@pudim.com.br"&gt;pudim@pudim.com.br&lt;/a&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="SiteBuilder_HostedBY" style="float: right; color: #333333"&gt;
              Hosted by &lt;a href="http://www.tecla.com.br/" target="_blank" style="font-weight:bold; color:#333333"&gt;Tecla&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I´ve used a very simple site as a example. The variable "response" will be a string. And I want to be able to get from this string whatever value I want, for example the source of the imagine or the page tittle.</p>
  
  <p>Ultimately I want to use Google SpreadSheet to get some information from a series of URL. I would have the URL in one column and in the other columns I would like to get the name an value of some products from an e-commerce. </p>
  
  <p>I realize that there might be some easier ways to accomplish that. I´m asking for a Google App Script solution because this is the language that I´m most familiar with. However, if there is no possible way to accomplish that using Google App Script, I would be very glad to hear about some alternatives.</p>
  
  <p>Thank You Very Much!</p>