Extracting an Html Link
Posted: Thu Aug 09, 2012 6:14 am
Hi, a site I am trying to scrape has an external link to another website with javascript:void(0). I need to scrape the actual external link.
The code on the site is below and I would need to scrape the http://www.xyz.com out of this java script. Is that possible with Helium and if so can some one show me how?
Thanks in advance!
The code on the site is below and I would need to scrape the http://www.xyz.com out of this java script. Is that possible with Helium and if so can some one show me how?
Thanks in advance!
Code: Select all
<div class="sponsorbanner"><script type="text/javascript" language="javascript">
var browName = navigator.appName;
var SiteID = 1;
var ZoneID = 385;
var siteUrl ='http://banner.thissiteurl.com/';
var browDateTime = (new Date()).getTime();
if (browName=='Netscape')
{
document.write('<s'+'cript lang' + 'uage="jav' + 'ascript" src="' + siteUrl + 'a.aspx?ZoneID=' + ZoneID + '&Task=Get&IFR=False&Browser=NETSCAPE4&PageID=89304&SiteID=' + SiteID + '&Random=' + browDateTime + '">'); document.write('</'+'scr'+'ipt>');
}
else
{
document.write('<s'+'cript lang' + 'uage="jav' + 'ascript" src="' + siteUrl + 'a.aspx?ZoneID=' + ZoneID + '&Task=Get&IFR=False&PageID=89304&SiteID=' + SiteID + '&Random=' + browDateTime + '">'); document.write('</'+'scr'+'ipt>');
}
</script>
</div>
<div id="ContentPlaceHolder1_UpdatePanel">
<div class="locatorleftsubleftcolumn">
<div class="bold12px"><a href="javascript:void(0)" rel="nofollow" onclick="javascript:window.open('http://www.xyz.com',StoreWebsite'); " >XYZ Store <img src="http://images.thissiteurl.com.com/ newwindow_icon.gif" width="16" height="13" alt="Go to XYZ Website" /></a></div>