I am able to scrape a page for URLs, but I want to know what is the easiest way to convert the various formats that these links can be in, into a fully fledged url. For example:
If I scrape: www.mysite.com/some/place/in/space.html
And I get the following urls:
../img.jpg
img.jpg
../../bla.jpg
inc/bla.jpg
/
./
They should resolve to
www.mysite.com/some/place/img.jpg
www.mysite.com/some/place/in/img.jpg
www.mysite.com/some/bla.jpg
www.mysite.com/some/place/in/inc/bla.jpg
www.mysite.com/some/place/in/
www.mysite.com/some/place/in/
Is there a function that does this for all cases or is it something I would have to code?