title: iOpus iMacros script for simple URL scrape
body: <p>Trying to exctract a link url with iMacros for Firefox plugin.</p>
  
  <p>The following <strong>input</strong> html code is on the website to be scraped: a link url and a description</p>
  
  <pre><code>&lt;div class="subcl"&gt;
      &lt;a href="http://www.url.com/someurl.html" target="_blank"&gt;description&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Desired <strong>output</strong> from iMacros: simply the link url</p>
  
  <pre><code>http://www.url.com/someurl.html
  </code></pre>
  
  <p>Since there are further links on the website the class="subcl" should be included in the code. Maybe there is a way to implement a nested structure?  I would prefer - if possible - non Javascript code since I don't code in it myself.</p>
  
  <p>The following <strong>macro code didn't work</strong></p>
  
  <pre><code>VERSION BUILD=8300326 RECORDER=FX
  TAB T=1
  
  'Open the website
  URL GOTO=http://www.url.com/pagetobescraped.html
  
  'Extract the link url on the page
  TAG POS=1 TYPE=DIV ATTR=CLASS:subcl* EXTRACT=HREF
  </code></pre>
  
  <p>The macro returns <code>#EANF#</code> (end of file reached with no match).  When I replace <code>EXTRACT=HREF</code> with <code>EXTRACT=TXT</code> it returns <code>"description"</code> but I need the URL.</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>to clarify symbiotech's answer:  the input html code is preceeded by the elements <code>&lt;h1&gt;</code> as well as <code>&lt;p&gt;</code>.  All togehter it looks like this ...</p>
  
  <pre><code>&lt;h1&gt;Title of the page&lt;/h1&gt;&lt;p class="intro"&gt;&lt;/p&gt;
  
  &lt;div class="subcl"&gt;
      &lt;a href="http://www.url.com/someurl.html" target="_blank"&gt;description&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>