# đ¤ PulsarRPA
[](https://hub.docker.com/r/galaxyeye88/pulsar-rpa)
[](https://github.com/platonai/PulsarRPA/blob/main/LICENSE)
[](https://spring.io/projects/spring-boot)
---
English | [įŽäŊ䏿](README-CN.md) | [ä¸åŊéå](https://gitee.com/platonai_galaxyeye/PulsarRPA)
## đ Introduction
đ **PulsarRPA: The AI-Powered, Lightning-Fast Browser Automation Solution!** đ
### ⨠Key Capabilities:
- đ¤ **AI Integration with LLMs** â Smarter automation powered by large language models.
- ⥠**Ultra-Fast Automation** â Coroutine-safe browser automation concurrency, spider-level crawling performance.
- đ§ **Web Understanding** â Deep comprehension of dynamic web content.
- đ **Data Extraction APIs** â Powerful tools to extract structured data effortlessly.
---
Automate the browser and extract data at scale with simple text.
```text
Go to https://www.amazon.com/dp/B08PP5MSVB
After browser launch: clear browser cookies.
After page load: scroll to the middle.
Summarize the product.
Extract: product name, price, ratings.
Find all links containing /dp/.
```
---
## đĨ Demo Videos
đŦ YouTube:
[](https://www.youtube.com/watch?v=_BcryqWzVMI)
đē Bilibili:
[https://www.bilibili.com/video/BV1kM2rYrEFC](https://www.bilibili.com/video/BV1kM2rYrEFC)
---
# đ Quick Start Guide
## âļī¸ Run PulsarRPA
### đĻ Run the Executable JAR â Best Experience
#### đ§Š Download
```shell
curl -L -o PulsarRPA.jar https://github.com/platonai/PulsarRPA/releases/download/v3.0.14/PulsarRPA.jar
```
#### đ Run
```shell
# make sure LLM api key is set. VOLCENGINE_API_KEY/OPENAI_API_KEY also supported.
echo $DEEPSEEK_API_KEY
java -D"DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}" -jar PulsarRPA.jar
```
> đ **Tip:** Make sure `DEEPSEEK_API_KEY` or other LLM API key is set in your environment, or AI features will not be available.
> đ **Tip:** Windows PowerShell syntax: `$env:DEEPSEEK_API_KEY` (environment variable) vs `$DEEPSEEK_API_KEY` (script variable).
---
đ Resources
* đĻ [GitHub Release Download](https://github.com/platonai/PulsarRPA/releases/download/v3.0.14/PulsarRPA.jar)
* đ [Mirror / Backup Download](https://static.platonai.cn/repo/ai/platon/pulsar/)
* đ ī¸ [LLM Configuration Guide](docs/config/llm/llm-config.md)
* đ ī¸ [Configuration Guide](docs/config.md)
### âļ Run with IDE
- Open the project in your IDE
- Run the `ai.platon.pulsar.app.PulsarApplicationKt` main class
### đŗ Docker Users
```shell
# make sure LLM api key is set. VOLCENGINE_API_KEY/OPENAI_API_KEY also supported.
echo $DEEPSEEK_API_KEY
docker run -d -p 8182:8182 -e DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY} galaxyeye88/pulsar-rpa:latest
```
---
## đ For Beginners â Just Text, No Code!
Use the `commands` API to perform browser operations, extract web data, analyze websites, and more.
### đĨ Example Request (Text-based):
WebUI: http://localhost:8182/command.html
REST API
#### đ Plain-Text-Based Version:
```shell
curl -X POST "http://localhost:8182/api/commands/plain" -H "Content-Type: text/plain" -d '
Go to https://www.amazon.com/dp/B08PP5MSVB
After browser launch: clear browser cookies.
After page load: scroll to the middle.
Summarize the product.
Extract: product name, price, ratings.
Find all links containing /dp/.
'
```
#### đ JSON-Based Version:
```shell
curl -X POST "http://localhost:8182/api/commands" -H "Content-Type: application/json" -d '{
"url": "https://www.amazon.com/dp/B08PP5MSVB",
"onBrowserLaunchedActions": ["clear browser cookies"],
"onPageReadyActions": ["scroll to the middle"],
"pageSummaryPrompt": "Provide a brief introduction of this product.",
"dataExtractionRules": "product name, price, and ratings",
"uriExtractionRules": "all links containing `/dp/` on the page"
}'
```
đĄ **Tip:** You don't need to fill in every field â just what you need.
## đ For Advanced Users â LLM + X-SQL: Precise, Flexible, Powerful
Harness the power of the `x/e` API for highly precise, flexible, and intelligent data extraction.
```shell
curl -X POST "http://localhost:8182/api/x/e" -H "Content-Type: text/plain" -d "
select
llm_extract(dom, 'product name, price, ratings') as llm_extracted_data,
dom_base_uri(dom) as url,
dom_first_text(dom, '#productTitle') as title,
dom_first_slim_html(dom, 'img:expr(width > 400)') as img
from load_and_select('https://www.amazon.com/dp/B08PP5MSVB', 'body');
"
```
The extracted data example:
```json
{
"llm_extracted_data": {
"product name": "Apple iPhone 15 Pro Max",
"price": "$1,199.00",
"ratings": "4.5 out of 5 stars"
},
"url": "https://www.amazon.com/dp/B08PP5MSVB",
"title": "Apple iPhone 15 Pro Max",
"img": "
"
}
```
* X-SQL Guide: [X-SQL](docs/x-sql.md)
---
## đ¨âđģ For Experts - Native API: Powerful!
### đ Superfast Page Visiting and Data Extraction:
PulsarRPA enables high-speed parallel web scraping with coroutine-based concurrency, delivering efficient data extraction
while minimizing resource overhead.
```kotlin
val args = "-refresh -dropContent -interactLevel fastest"
val resource = "seeds/amazon/best-sellers/leaf-categories.txt"
val links =
LinkExtractors.fromResource(resource).asSequence().map { ListenableHyperlink(it, "", args = args) }.onEach {
it.eventHandlers.browseEventHandlers.onWillNavigate.addLast { page, driver ->
driver.addBlockedURLs(blockingUrls)
}
}.toList()
session.submitAll(links)
```
đ Example: [View Kotlin Code](https://github.com/platonai/PulsarRPA/blob/master/pulsar-app/pulsar-examples/src/main/kotlin/ai/platon/pulsar/examples/advanced/HighPerformanceCrawler.kt)
### đŽ Browser Control:
PulsarRPA implements coroutine-safe browser control.
```kotlin
val prompts = """
move cursor to the element with id 'title' and click it
scroll to middle
scroll to top
get the text of the element with id 'title'
"""
val eventHandlers = DefaultPageEventHandlers()
eventHandlers.browseEventHandlers.onDocumentActuallyReady.addLast { page, driver ->
val result = session.instruct(prompts, driver)
}
session.open(url, eventHandlers)
```
đ Example: [View Kotlin Code](/pulsar-app/pulsar-examples/src/main/kotlin/ai/platon/pulsar/examples/llm/TalkToActivePage.kt)
---
### đ¤ Robotic Process Automation Capabilities:
PulsarRPA provides flexible robotic process automation capabilities.
```kotlin
val options = session.options(args)
val event = options.eventHandlers.browseEventHandlers
event.onBrowserLaunched.addLast { page, driver ->
warnUpBrowser(page, driver)
}
event.onWillFetch.addLast { page, driver ->
waitForReferrer(page, driver)
waitForPreviousPage(page, driver)
}
event.onWillCheckDocumentState.addLast { page, driver ->
driver.waitForSelector("body h1[itemprop=name]")
driver.click(".mask-layer-close-button")
}
session.load(url, options)
```
đ Example: [View Kotlin Code](/pulsar-app/pulsar-examples/src/main/kotlin/ai/platon/pulsar/examples/sites/food/dianping/RestaurantCrawler.kt)
---
### đ Complex Data Extraction with X-SQL:
PulsarRPA provides X-SQL for complex data extraction.
```sql
select
llm_extract(dom, 'product name, price, ratings, score') as llm_extracted_data,
dom_first_text(dom, '#productTitle') as title,
dom_first_text(dom, '#bylineInfo') as brand,
dom_first_text(dom, '#price tr td:matches(^Price) ~ td') as price,
dom_first_text(dom, '#acrCustomerReviewText') as ratings,
str_first_float(dom_first_text(dom, '#reviewsMedley .AverageCustomerReviews span:contains(out of)'), 0.0) as score
from load_and_select('https://www.amazon.com/dp/B08PP5MSVB -i 1s -njr 3', 'body');
```
đ Example Code:
* [Amazon Product Page Scraping (100+ fields)](https://github.com/platonai/exotic-amazon/tree/main/src/main/resources/sites/amazon/crawl/parse/sql/crawl)
* [All Amazon Page Types Scraping](https://github.com/platonai/exotic-amazon/tree/main/src/main/resources/sites/amazon/crawl/parse/sql/crawl)
---
## đ Documents
* đ [REST API Examples](docs/rest-api-examples.md)
* đ ī¸ [LLM Configuration Guide](docs/config/llm/llm-config.md)
* đ ī¸ [Configuration Guide](docs/config.md)
* đ [Build from Source](docs/development/build.md)
* đ§ [Expert Guide](docs/advanced-guides.md)
---
## đ§ Proxies - Unblock Websites
Set the environment variable PROXY_ROTATION_URL to the URL provided by your proxy service:
```shell
export PROXY_ROTATION_URL=https://your-proxy-provider.com/rotation-endpoint
```
Each time the rotation URL is accessed, it should return a response containing one or more fresh proxy IPs.
Ask your proxy provider for such a URL.
---
## ⨠Features
đˇī¸ **Web Spider**
- Scalable crawling
- Browser rendering
- AJAX data extraction
đ¤ **AI-Powered**
- Automatic field extraction
- Pattern recognition
- Accurate data capture
đ§ **LLM Integration**
- Natural language web content analysis
- Intuitive content description
đ¯ **Text-to-Action**
- Simple language commands
- Intuitive browser control
đ¤ **RPA Capabilities**
- Human-like task automation
- SPA crawling support
- Advanced workflow automation
đ ī¸ **Developer-Friendly**
- One-line data extraction
- SQL-like query interface
- Simple API integration
đ **X-SQL Power**
- Extended SQL for web data
- Content mining capabilities
- Web business intelligence
đĄī¸ **Bot Protection**
- Advanced stealth techniques
- IP rotation
- Privacy context management
⥠**Performance**
- Parallel page rendering
- High-efficiency processing
- Block-resistant design
đ° **Cost-Effective**
- 100,000+ pages/day
- Minimal hardware requirements
- Resource-efficient operation
â
**Quality Assurance**
- Smart retry mechanisms
- Precise scheduling
- Complete lifecycle management
đ **Scalability**
- Fully distributed architecture
- Massive-scale capability
- Enterprise-ready
đĻ **Storage Options**
- Local File System
- MongoDB
- HBase
- Gora support
đ **Monitoring**
- Comprehensive logging
- Detailed metrics
- Full transparency
## đ Contact Us
- đŦ WeChat: galaxyeye
- đ Weibo: [galaxyeye](https://weibo.com/galaxyeye)
- đ§ Email: galaxyeye@live.cn, ivincent.zhang@gmail.com
- đĻ Twitter: galaxyeye8
- đ Website: [platon.ai](https://platon.ai)