I am trying to read online html document and parse some data from it using Angular. The problem is I am keep getting an error about cors
. My code for reading html document is:
loadParsingData(htmlToParse:String){
let retVal = this.http.get(htmlToParse.toString())
.map(res => res.text())
return retVal; }
When I try to test this code I expect to get html document from given website (for example imdb most popular movies) as argument, but all I get is:
XMLHttpRequest cannot load http://www.imdb.com/chart/moviemeter?ref_=nv_mv_mpm_8. No 'Access-Control-Allow-Origin' header is present on the requested resource.
Can anyone please help me? Thank you in beforehand.