Relative URL

Questions and answers about anything related to Helium Scraper
Post Reply
Apexmodels
Posts: 2
Joined: Mon Jul 11, 2016 6:16 pm

Relative URL

Post by Apexmodels » Fri Jul 22, 2016 4:23 pm

Hi,

I have created a project to scrape links, unfortunately the web site uses relative URLS, as below. I know the first part of the link, how can I insert this into my table?

<a href="../cgi-bin/wti0001p?&I=LXGBJU&P=Z"</a>

I want it to autocomplete to

<a href="www.targetsite.com/cgi-bin/wti0001p?&I=LXGBJU&P=Z"</a>

Thanks,

Richard

webmaster
Site Admin
Posts: 491
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Relative URL

Post by webmaster » Wed Aug 10, 2016 8:23 am

Are you using the Link property? Try creating a JavaScript Gatherer called Link with this code:

Code: Select all

return element.href
or

Code: Select all

return element.getAttribute("href");
and extracting the JS_Link property.
Juan Soldi
The Helium Scraper Team

Leesajohnson
Posts: 2
Joined: Thu Nov 02, 2017 6:23 am
Location: London

Re: Relative URL

Post by Leesajohnson » Sat Nov 04, 2017 6:38 am

You can define code into javascript file and set a code into a main page like this
Code: Select all
return element.getAttribute("href");

Post Reply