0
I would like to access an external page(google for example), and inside it running a script to capture all hrefs, I read about the fact that browsers don’t allow using GET to get html, but I believe there must be a way to do this, I have this code for now. I read about the googlebot, and I’d like to try doing this on JS.
$.ajax({
url: 'http://google.com',
type: 'GET',
success: function(res) {
$('a').each(function() {
alert($this.href);
});
}
});
"but I believe there must be a way to do this" - if the site does not want to allow this (closed CORS) then does not give, for security/privacy reasons. The only option is to do on the server.
– Sergio
There is no way to simulate a user, or browser, since I can access normally, there is a way to simulate this ??
– Lucas Caresia
If there was a way to simulate the user then you could trigger clicks on ads or youtube Likes via ajax and cheat the system. It’s to prevent that. Take a look at CORS https://answall.com/a/145493/129
– Sergio