title: Find the first link with given tag and open it (userscript)
body: <p>This seems a simple problem, still I cannot manage to find out how to solve it.</p>
  
  <p>I'd like to write a greasemonkey userscript for a webshop what is doing the next when I open their site (what is basically a listing of items under each other).</p>
  
  <ul>
  <li><p>checking if there is any new items since my last visit 
  (in the html of the site there will be a "new " mark in their class)
  in case it finds 1 or more items with the new tag, go to the next step (else do nothing)</p></li>
  <li><p>redirect this main page to the first link with the "new " tag</p></li>
  </ul>
  
  <p>So when I open  <a href="http://mywebsite.com/" rel="nofollow">http://mywebsite.com/</a>  I should be redirected immediately to  <a href="http://mywebsite.com/forsale/100009/" rel="nofollow">http://mywebsite.com/forsale/100009/</a>  in this example.
  But I don't know what will be the url, that's why a script needs to check the links. Only the first match I need (new items are always on top). Not old (without the new tag) and not new items under/after the first one.</p>
  
  <p>This is how the website's source looks:</p>
  
  <pre><code>&lt;div class="item new "  id="item_0" style=""&gt;
    &lt;div class="item_click_overlay"&gt;
      &lt;a href="http://mywebsite.com/forsale/100009/"&gt;
      &lt;img src="http://mywebsite.com/pics/100009.gif"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="item new "  id="item_1" style=""&gt;
    &lt;div class="item_click_overlay"&gt;
      &lt;a href="http://mywebsite.com/forsale/100007/"&gt;
      &lt;img src="http://mywebsite.com/pics/100007.gif"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="item  "  id="item_2" style=""&gt;
    &lt;div class="item_click_overlay"&gt;
      &lt;a href="http://mywebsite.com/forsale/100006/"&gt;
      &lt;img src="http://mywebsite.com/pics/100006.gif"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="item  "  id="item_3" style=""&gt;
    &lt;div class="item_click_overlay"&gt;
      &lt;a href="http://mywebsite.com/forsale/100002/"&gt;
      &lt;img src="http://mywebsite.com/pics/100002.gif"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>