What are some methods to make relative urls absolute in scraped content so that the scraped html appears like the original and css are not broken?
I found out <base> tag may help. But how can I find out what the original base of the URL is?
I don't care about interactions with the links, but do want them to appear correct.
Assume a site 'example.com/blog/new/i.html' i scrape that has 2 resources

< link src="/style/style.css" > 
< link src="newstyle.css" >. 

Now if i set base as 'example.com/blog/new/i.html' wont the first one break
Keep track of the url of each page you scraped. One way would be to save it with the full URL as a filename. Then, you can resolve relative urls as per the HTML spec.
How best to handle relative urls in scraped content?