Selenium web scraper with login in n8n
This n8n workflow scrapes data from any web page, including pages behind a login, by driving a real browser through a Selenium container. It is for builders who need data that simple HTTP requests cannot reach, such as the star count of a GitHub project.
What it does
A webhook receives the target and the data to collect. The flow searches for the right URL, opens a Selenium session, can load cookies for logged in pages, takes the page content and uses an OpenAI model to extract the answer. Sessions are cleaned up and the result is returned.
How to use it
Deploy the Selenium container from the Docker Compose file in the associated GitHub repository, then connect OpenAI and call the webhook.
Requirements and limits
Needs a running Selenium container that n8n can reach.
More in GitHub and the n8n workflow library.
Full text
Front matter
name: Selenium Ultimate Scraper Workflow
description: Triggered by a webhook. Connects Code, Condition, Convert To File, HTTP request, Html, Limit, Respond To Webhook, Webhook. ## N8N Ultimate Scraper - Workflow This workflow's objective is to collect data from any website page, whether it requires login or not. For example, you can collect the number of stars of the n8n-ultimate-scraper project on GitHub. ## Requirements **Selenium Container**: Selenium is an open-source automation framework for web applications, enabling browser control and interaction through scripts in various programming languages. You can deploy the Docker Compose file from the associated GitH
category: Automation
kind: Workflow
software: Code|Condition|Convert To File|HTTP request|Html|Limit|Respond To Webhook|WebhookSelenium Ultimate Scraper Workflow
Triggered by a webhook. Connects Code, Condition, Convert To File, HTTP request, Html, Limit, Respond To Webhook, Webhook. ## N8N Ultimate Scraper - Workflow
This workflow's objective is to collect data from any website page, whether it requires login or not.
For example, you can collect the number of stars of the n8n-ultimate-scraper project on GitHub.
Requirements
Selenium Container: Selenium is an open-source automation framework for web applications, enabling browser control and interaction through scripts in various programming languages. You can deploy the Docker Compose file from the associated GitH
Steps
- Extract First Url Match (html)
- OpenAI Chat Model (noOp)
- Clean Webdriver (httpRequest)
- Delete Session (httpRequest)
- Delete Session2 (httpRequest)
- If Block1 (if)
- Delete Session3 (httpRequest)
- Limit (limit)
- Delete Session1 (httpRequest)
- Delete Session4 (httpRequest)
- Success with cookie (respondToWebhook)
- Respond to Webhook2 (respondToWebhook)
- Code (code)
- Delete Session5 (httpRequest)
- Error (respondToWebhook)
- Error1 (respondToWebhook)
- Error2 (respondToWebhook)
- If Node (if)
- Inject Cookie (httpRequest)
- Respond to Webhook3 (respondToWebhook)
- Success (respondToWebhook)
- Go on url (httpRequest)
- Delete Session6 (httpRequest)
- Error3 (respondToWebhook)
- Information Extractor (noOp)
- Check if empty of NA (if)
- If Block (if)
- Google search Query (httpRequest)
- Create Selenium Session (httpRequest)
- Get ScreenShot 1 (httpRequest)
- Refresh browser (httpRequest)
- Get ScreenShot (httpRequest)
- Convert to File (convertToFile)
- Convert to File1 (convertToFile)
- Delete Session7 (httpRequest)
- Sticky Note (stickyNote)
- Edit Fields (For testing prupose ) (set)
- Get ScreenShot 2 (httpRequest)
- Convert to File2 (convertToFile)
- Go on ip-api.com (httpRequest)
Import
Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).
Source and license
Source: https://github.com/Zie619/n8n-workflows/blob/main/Limit/1711_Limit_Code_Automate_Webhook.md
Author: Zie619, n8n workflow collection. License: MIT.
Shown here with formatting for the web. Keep the author and license notice when you reuse it.
Related entries
- Toolworkflow Workflow
- Webhook Workflow: HTTP request, Respond To Webhook and Webhook
- Manualtrigger Workflow: Function, HTTP request and Html Extract
- Webhook Workflow: Respond To Webhook and Webhook (n8n workflow collection) (Respondtowebhook) (410)
- Lmchatopenrouter Workflow
- Production Workflow: Notion, Condition and HTTP request
There are more like this in the members library
The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.