title: Scrape certain links from a page with javascript
body: <p><b>Here is a sample block of code I need to scrape:</b></p>
  
  <pre><code>&lt;p&gt;This paragraph contains &lt;a href="http://twitter.com/chsweb" data-placement="below" rel="twipsy" target="_blank" data-original-title="Twitter"&gt;links to Twitter folks&lt;/a&gt;, and &lt;a href="http://twitter.com/blogcycle" data-placement="below" rel="twipsy" target="_blank" data-original-title="Twitter"&gt;more links to other Twitter folks&lt;/a&gt;, but it also contains &lt;a href="http://www.someOtherWebsiteHere.com"&gt;non-Twitter links too&lt;/a&gt;.  How can I list only the Twitter links below?&lt;/p&gt;
  </code></pre>
  
  <p><b>This script generates a list of every URL on the page:</b></p>
  
  <pre><code>&lt;script&gt;
  var allLinks = document.links;
  for (var i=0; i&lt;allLinks.length; i++) {
    document.write(allLinks[i].href+"&lt;BR/&gt;");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><b>How do I modify the script so that it only lists URLs that contain a certain domain, e.g.; twitter.com/?</b></p>
  
  <p>Here is a demo page:
  <a href="http://chsweb.me/OucTum" rel="nofollow">http://chsweb.me/OucTum</a></p>