I want to log in to a site that uses Ajax

Hello, I need help.
I have a website that I log into to check all registered customers.

Login is done here
https://shoficina.com.br/espacoweb/login

I used n8n to access, but if I use the url above, it gives an error, I looked at the source codes and got the correct url from javascript.
Which is this:
https://shoficina.com.br/builders/methods/espacoweb_login.method.php

content: function(){
                            var self = this;
                            return $.ajax({
                                url: '../builders/methods/espacoweb_login.method.php',
                                dataType: 'json',
                                method: 'post',
                                data: {user: user,key: key}
                            }).done(function(responseLogin) {
                                console.log(responseLogin.status);
                                
                                if (responseLogin.status == '1') {
                                    self.setTitle('');
                                    self.setContent('Acessando');
                                    window.location = "/espacoweb/ordens";
                                }

If login is successful, give the code below
{ “status”:“1”}

I’ve gotten this far, if you notice, after logging in, it accesses the panel “/espacoweb/ordens”.

I tried everything and I’m stuck at login status 1

Another url that could give me the information I wanted would be this:
https://shoficina.com.br/builders/methods/espacoweb_json_listarTodasOS.method.php

{
“meta”: {
“instanceId”: “87a6d627f8bfeeeda8946e9f5921ab369649eaf87fc95da04986cee3326ffccb”
},
“nodes”: ,
“connections”: {},
“pinData”: {}
}

Any ideas on how to do it?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

N8n 1.54.4
Running Docker
Ubuntu 20.04

Hey @tectonny

Welcome to the community :+1:

You will likely need to return the full response and set the cookie header in the second node to continue using it, some sites though are tricky to work with and there is no one step approach to it.

So for now the n8n still can’t do it?

Hey @tectonny,

It might be possible to do it but we don’t have an example for it and it really depends on the site.

What do you need?
Can I provide test data

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.