What prevents me from using $.ajax to load another domain's html?

前端 未结 4 1389
遇见更好的自我
遇见更好的自我 2020-12-17 06:31

My domain:

  


scrape


        
4条回答
  •  春和景丽
    2020-12-17 07:04

    It's the Same Origin Policy, which prevents cross-domain requests. If you want to scrape html, you are better off writing a server side process to get the content, then use ajax to make a request against your server, which contains the harvested data.

提交回复
热议问题