-3

When I scrape data which includes images from other websites, I encounter the following error:

$.get('https://truyenvua.com/128/1081/1.jpg?gt=hdfgdfg', function (data) { console.log(data) }); An error occurred as follows.

enter image description here

Please help me with the solution

Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
HungTV
  • 1

1 Answers1

1

The remote domain needs to explicitly allow cross-origin requests for images by adding the appropriate CORS headers to the HTTP response. The fact that they haven't means it's likely that they do not want their images scraped. Their server simply will not return images requested by third party domains.

Matt
  • 549
  • 4
  • 11