Changing relative URLs of Javascript files
问题 I'm screen scraping using Curl like this: <?php $url = "http://www.bbc.com/news/"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $curl_scraped_page = curl_exec($ch); curl_close($ch); echo $curl_scraped_page; ?> And then I echo the content on an HTML page. The problem is that when I look in my console I see 404 errors because of relative URLs assigned to javascript files. For instance if the URL is: somejavascriptfile.js on loading the page my domain name is added like