Help me to Automate Web Page

Hey there, I would like to automate a web application using n8n. The workflow should open a browser, navigate to a specified URL, wait for the page to load completely, enter login credentials, sign in, click the required buttons, scrape the necessary data from the page, and then export the extracted data into an Excel file. Could you guide me on how to set this up in n8n?

Start by checking whether the app has an API, export URL, or report download. Driving a browser through login is the fragile fallback, especially if the site has 2FA, captcha, or buttons that change.

For a first n8n test, narrow it to one page after login: one URL, one table/list to extract, and the exact Excel columns you expect. Do not post credentials or private URLs here; just the app type and the target page shape.

@Sakthi adding to oimrqs, if theres any API or export endpoint, use it and skip the browser, way less fragile. but if you really need to log in and click through the UI, heads up n8n core has no browser-driving node, so two routes:

  • self-hosted: a community node like n8n-nodes-puppeteer or playwright to script the browser.
  • on cloud, or to skip running a browser: an external headless service like Browserless via the HTTP Request node, it does the login/click/scrape and returns the html.

then pull the fields with the HTML Extract node and write it out with Convert to File set to xlsx. but exhaust the API route first like oimrqs said, ui flows break the second a button or login changes.

Thanks for the guidance. My exact scenario is opening the SAP window, logging in, entering the tcode, navigating to the table, clicking the extract button, and saving the data to the local drive. Since API keys aren’t provided, I’m planning to proceed via UI automation.

I’m working on a self-hosted setup and plan to use a community node (Playwright) or n8n-node-puppeteer for browser automation. Do you have a sample structure or a reference workflow that would help me configure this approach effectively? is this method works

@Sakthi important catch, if thats the SAP GUI desktop client (the SAP Logon window with tcodes), Playwright and puppeteer cant automate it, theyre browser-only. theyd only work if your SAP is the browser-based Fiori/WebGUI.

two real options:

  1. if it has to be the desktop GUI: thats SAP GUI Scripting territory, not a browser tool. you enable it and drive it with something like Robot Frameworks SapGuiLibrary or a windows RPA tool, n8n cant touch the desktop gui directly so youd trigger that script (via Execute Command/SSH), let it do the tcode → extract → save file, then n8n picks the file up.

  2. better, skip the gui: SAP isnt really “no API”, it exposes OData/RFC you auth with your normal SAP user creds (basic auth, no separate key). the table youre pulling is almost certainly an OData service or CDS view, ask your Basis admin which one, then its just an HTTP Request in n8n, no fragile UI at all.

id push hard for option 2.

Thanks for the clarification. I’ll pursue option 2.

Just to confirm: with SAP OData/CDS endpoints and service name something like this (GET /sap/opu/odata/sap/service name/table name), can we navigate and query directly using the HTTP node with our SAP username/password itself, without any API keys? Also, is there any setup or enablement needed from the SAP team side (permissions, enabled services, service name, etc.)?
If it works, do you have a sample JSON flow with those steps you’ve tried? It would be really helpful.

Welcome @Sakthi! Yes, SAP OData works with the HTTP Request node using Basic Auth - no API keys, just your SAP username/password. Set the method to GET, URL to https://your-sap-host/sap/opu/odata/sap/SERVICE_NAME/ENTITY_SET, and under Authentication select “Basic Auth” with your SAP credentials. Add the header sap-client: 100 (replace 100 with your client number) and Accept: application/json so the response comes back as JSON instead of XML. The SAP team needs to have enabled the service in transaction SOAMANAGER or /IWFND/MAINT_SERVICE first, and your SAP user needs the appropriate authorization objects - if you get a 403, that’s usually a missing auth role on the SAP side.

@Sakthi yep, exactly what nguyenthieutoan covered on the auth/service side. heres a minimal importable flow, just swap your host/service/entity and point the HTTP node at your Basic Auth credential:

one thing to adjust: OData v2 returns your rows under d.results (whats in the Split Out), v4 returns them under value, so change that field to match your service.

One thing worth adding for the OData route, use $top and $skip query params to paginate large tables, otherwise SAP will cap the response usually at 100–500 rows and you’ll think you got everything but didn’t.

Example:

/sap/opu/odata/sap/SERVICE/ENTITY?$top=500&$skip=0

In n8n, loop this with a Loop Over Items node, incrementing $skip each time until the result count is less than $top, that’s your exit condition.

Also, if you get XML back instead of JSON, add $format=json to the URL rather than relying solely on the Accept header, some SAP versions need both.