It is mainly used in web scraping when you need to extract data from pages that require JavaScript execution (like dynamic content).
💡 Think of it as a lightweight browser you can control with code 🖥️🤖.
🔹 Normally, libraries like Requests + BeautifulSoup can only fetch static HTML.
🔹 But many modern websites load content dynamically (using JS frameworks like React, Angular, Vue).
🔹 Splash renders the page just like a browser → executes JS → returns the final HTML, images, or even screenshots.
🎨 1. JavaScript Rendering
Executes JavaScript just like Chrome or Firefox.
Helps extract hidden data from dynamic websites.
📸 2. Screenshots & Rendering
Take screenshots of the page.
Render specific elements only.
🔄 3. HTML & HAR Export
Export the rendered HTML.
Export HAR (HTTP Archive) files for debugging requests.
📜 4. Scriptable with Lua
Control Splash using Lua scripts for advanced automation (clicks, scrolls, etc.).
📦 5. Docker-Friendly
Runs inside Docker containers for easy deployment.
docker run -p 8050:8050 scrapinghub/splash
Fetch HTML after JS rendering:
http://localhost:8050/render.html?url=https://example.com
import requests
url = 'http://localhost:8050/render.html'
params = {'url': 'https://example.com', 'wait': 2}
response = requests.get(url, params=params)
print(response.text)
👉 Here wait=2
allows 2 seconds for JavaScript to load.
✅ Handles JavaScript-heavy websites ⚡
✅ Can be automated with Lua scripting 🤖
✅ Exports screenshots, HAR, HTML 📝
✅ Works well with Scrapy-Splash middleware 🕷️
⚡ Slower than static scraping (because it renders JS)
⚡ High CPU & memory usage (since it behaves like a browser)
⚡ Limited JavaScript support compared to modern browsers like Chrome/Playwright
⚡ Needs Docker setup for production
Imagine you want to scrape a stock website 📈 that loads prices using JavaScript.
Without Splash → you’ll just get an empty <div>
.
With Splash → you’ll get the fully rendered page with stock prices 🔥
Client (Scrapy/Python) → Sends request to Splash → Splash renders JS → Returns final HTML/JSON/Screenshot → Data Extracted
👉 In short:
Splash = Mini browser for scraping JavaScript-heavy sites 🌐🕸️