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

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

Now if i set base as 'example.com/blog/new/i.html' wont the first one break