mercredi 15 février 2017

Googe fun facts + angular

From my understanding, Google has reacently provided a new search service. To access this you simply "google": fun facts or i'm feeling curious

But is there a simple way to extract the information since I can't find an API for this?

I was simply trying this with angular 1.6 like this:

function getFunFact(){
    var URL = "http://ift.tt/1KrxgKo";
    $http.get(URL)
    .then(function(response){
          console.log(response);
    }).catch(function (e) {
          console.log(e);
    });
}

But I only get the Cross-origin resource sharing (CORS) error. Is there a way to bypass this to access the information via CSS selectors etcetera?




Aucun commentaire:

Enregistrer un commentaire