julia-browser


Namejulia-browser JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryA comprehensive Python-based CLI web browser with JavaScript support and modern web compatibility
upload_time2025-07-26 08:04:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords browser cli terminal web html css javascript markdown scraping automation headless spidermonkey pythonmonkey web-browser command-line text-based
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Julia Browser 🌐

A comprehensive Python-based CLI web browser with JavaScript support and modern web compatibility.

Julia Browser transforms command-line web browsing into a dynamic, intelligent experience with comprehensive JavaScript simulation and rendering capabilities.

## Features

- **Enhanced JavaScript Engine**: Mozilla SpiderMonkey integration via PythonMonkey
- **Modern Web Compatibility**: Full HTML DOM API, CSS Object Model (CSSOM), and modern JavaScript APIs
- **Interactive CLI Interface**: Rich terminal interface with comprehensive web interaction support
- **Advanced Navigation**: Back/forward, bookmarks, history, and smart link following
- **Intelligent Content Processing**: Dynamic content filtering and clean markdown output
- **Performance Optimizations**: Caching, asynchronous execution, and connection pooling
- **Real Web Interactions**: Form submission, file uploads, authentication flows
- **Multiple Output Formats**: Markdown, HTML, and JSON rendering
- **Responsive Design Detection**: Breakpoint analysis and mobile-first patterns

## Installation

```bash
pip install julia-browser
```

## Quick Start

### Command Line Interface

### Command Line Usage

```bash
# Browse a website
julia-browser browse https://example.com

# Start interactive mode
julia-browser interactive

# Render to different formats
julia-browser render https://api.github.com --format json
```

### AI Agent SDK 🤖

Julia Browser includes a clean, simple AI Agent SDK that enables AI systems to control websites exactly like humans do - with direct, intuitive functions that mirror CLI browser commands.

> **Perfect for:** Web automation, AI agents, research workflows, data collection, form automation, and human-like web interactions.

#### Simple Functions - Just Like CLI Commands

```python
from julia_browser import AgentSDK

# Initialize AI agent
agent = AgentSDK()

# Open a website (like CLI 'browse' command)
result = agent.open_website("https://example.com")
print(f"Opened: {result['title']}")

# List interactive elements (like CLI 'elements' command)
elements = agent.list_elements()
print(f"Found {elements['total_clickable']} clickable elements")

# Type into input fields (like CLI 'type' command)
agent.type_text(1, "search query")

# Click buttons or links (like CLI 'click' command)
agent.click_element(1)

# Submit forms (like CLI form submission)
result = agent.submit_form()
print(f"Form submitted: {result['title']}")
```

#### Complete AI Agent SDK Functions

**Core Website Functions:**
- `open_website(url)` - Open any website and get page content
- `list_elements()` - List all clickable elements and input fields with numbers
- `get_page_info()` - Get current page title, URL, and full content
- `search_page(term)` - Search for text within the current page

**Human-like Interactions:**
- `click_element(number)` - Click buttons or links by their number
- `type_text(field_number, text)` - Type text into input fields by number
- `submit_form()` - Submit forms with typed data
- `follow_link(number)` - Navigate to links by their number

#### Real-World Usage Examples

**1. Simple Web Search:**
```python
agent = AgentSDK()

# Open search engine
agent.open_website("https://duckduckgo.com")

# Type search query into first input field
agent.type_text(1, "Python programming")

# Submit the form
result = agent.submit_form()
print(f"Search results: {result['title']}")
```

**2. Form Automation:**
```python
agent = AgentSDK()

# Open a form page
agent.open_website("https://httpbin.org/forms/post")

# List all available elements
elements = agent.list_elements()
print(f"Found {elements['total_inputs']} input fields")

# Fill form fields by number
agent.type_text(1, "John Doe")      # First field
agent.type_text(2, "555-1234")      # Second field

# Submit the completed form
result = agent.submit_form()
```

**3. Website Navigation:**
```python
agent = AgentSDK()

# Open website
agent.open_website("https://example.com")

# List clickable elements
elements = agent.list_elements()
for button in elements['buttons']:
    print(f"Button {button['number']}: {button['text']}")

# Click the first link/button
result = agent.click_element(1)

# Search current page for specific content
search = agent.search_page("information")
print(f"Found '{search['search_term']}' {search['matches_found']} times")
```

#### AI Agent Response Format

All AI Agent SDK methods return structured dictionaries with consistent formats:

```python
{
    'success': True,
    'page_title': 'Example Domain',
    'url': 'https://example.com',
    'markdown': '# Page Content...',
    'forms': 1,
    'buttons': 3,
    'inputs': 5,
    'links': 12,
    'matches_found': 2,
    'error': None
}
```

#### Integration with AI Systems

The AI Agent SDK is specifically designed for integration with AI frameworks and automation platforms:

**LangChain Integration:**
```python
from julia_browser import AgentSDK
from langchain.tools import BaseTool

class JuliaBrowserTool(BaseTool):
    name = "julia_browser"
    description = "Navigate and interact with websites"
    
    def _run(self, url: str) -> str:
        agent = AgentSDK()
        result = agent.navigate(url)
        return result['markdown']
```

**OpenAI Function Calling:**
```python
import openai
from julia_browser import AgentSDK

def browse_website(url: str):
    """Browse a website and return its content"""
    agent = AgentSDK()
    return agent.navigate(url)

# Register as OpenAI function
functions = [{
    "name": "browse_website",
    "description": "Browse and analyze website content",
    "parameters": {
        "type": "object",
        "properties": {
            "url": {"type": "string", "description": "Website URL to browse"}
        }
    }
}]
```

**Autonomous Agent Workflows:**
```python
# Multi-step research workflow
agent = AgentSDK()

# Step 1: Search for information
agent.navigate("https://duckduckgo.com")
agent.fill_input(0, "artificial intelligence trends 2024")
agent.submit_form()

# Step 2: Follow first result
agent.follow_link(0)

# Step 3: Extract specific data
insights = agent.search_page("machine learning")
print(f"Found {insights['matches_found']} ML references")

# Step 4: Continue to related pages
elements = agent.get_elements()
if elements['links'] > 0:
    agent.follow_link(0)  # Follow related link
```

#### Why Choose Julia Browser AI Agent SDK?

- **🎯 Human-like Interaction**: Functions mirror exactly how humans browse websites
- **🔢 Simple Numbering**: All elements are numbered - just click_element(1), type_text(1, "hello")
- **📊 Clean Responses**: Consistent JSON responses with success/error handling
- **🌐 Real Websites**: Handles modern sites with JavaScript, forms, and dynamic content
- **🚀 Zero Setup**: No browser installation or complex configuration needed
- **⚡ Direct Commands**: Each function does exactly one thing, like CLI commands

## Advanced Features

### Python API

```python
from julia_browser import BrowserEngine, BrowserSDK

# Initialize browser
sdk = BrowserSDK()

# Browse a website
result = sdk.browse_url("https://example.com")
print(result['markdown'])

# Interactive CLI
from julia_browser import CLIBrowser
browser = CLIBrowser()
browser.start_interactive_mode()
```

## Interactive Mode Commands

- `browse <url>` - Navigate to a website
- `elements` - Show all interactive elements (buttons, links, forms)
- `click <number>` - Click on numbered elements
- `type <text>` - Type into input fields
- `submit` - Submit forms
- `back/forward` - Navigate browser history
- `bookmark add <name>` - Save bookmarks
- `help` - Show all commands

## Advanced Features

### JavaScript Support
- Full ES6+ compatibility with Mozilla SpiderMonkey
- React, Vue, Angular framework support
- Real API calls and network requests
- Modern browser API simulation

### Web Interaction
- Smart form handling with real submission
- File upload support
- Authentication flows and session management
- Cookie handling and persistent sessions

### Performance
- Intelligent caching with SQLite backend
- Asynchronous request handling
- Connection pooling and optimization
- Lazy loading for large websites

## Examples

### Browse and Interact
```bash
julia-browser interactive
> browse github.com
> elements
> click 1  # Click login button
> type username myuser
> type password mypass
> submit
```

### API Integration
```python
from julia_browser import BrowserSDK

sdk = BrowserSDK()

# Handle JSON APIs
result = sdk.browse_url("https://api.github.com/users/octocat")
user_data = result['json_data']

# Process forms
result = sdk.submit_form("https://httpbin.org/post", {
    "username": "test",
    "email": "test@example.com"
})
```

## Requirements

- Python 3.8+
- PythonMonkey (Mozilla SpiderMonkey)
- Rich (terminal formatting)
- Click (CLI framework)
- BeautifulSoup4 (HTML parsing)
- Requests (HTTP client)

## License

MIT License - see LICENSE file for details.

## Contributing

Contributions welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.

## Links

- [Documentation](https://docs.juliabrowser.com)
- [GitHub Repository](https://github.com/juliabrowser/julia-browser)
- [Issue Tracker](https://github.com/juliabrowser/julia-browser/issues)
- [PyPI Package](https://pypi.org/project/julia-browser/)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "julia-browser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "browser, cli, terminal, web, html, css, javascript, markdown, scraping, automation, headless, spidermonkey, pythonmonkey, web-browser, command-line, text-based",
    "author": null,
    "author_email": "Julia Browser Development Team <dev@juliabrowser.com>",
    "download_url": "https://files.pythonhosted.org/packages/11/af/6f74a2c520099a1af80dd6cca8951ef71c39bcd34fc225da84a0a6e38052/julia_browser-1.2.0.tar.gz",
    "platform": null,
    "description": "# Julia Browser \ud83c\udf10\n\nA comprehensive Python-based CLI web browser with JavaScript support and modern web compatibility.\n\nJulia Browser transforms command-line web browsing into a dynamic, intelligent experience with comprehensive JavaScript simulation and rendering capabilities.\n\n## Features\n\n- **Enhanced JavaScript Engine**: Mozilla SpiderMonkey integration via PythonMonkey\n- **Modern Web Compatibility**: Full HTML DOM API, CSS Object Model (CSSOM), and modern JavaScript APIs\n- **Interactive CLI Interface**: Rich terminal interface with comprehensive web interaction support\n- **Advanced Navigation**: Back/forward, bookmarks, history, and smart link following\n- **Intelligent Content Processing**: Dynamic content filtering and clean markdown output\n- **Performance Optimizations**: Caching, asynchronous execution, and connection pooling\n- **Real Web Interactions**: Form submission, file uploads, authentication flows\n- **Multiple Output Formats**: Markdown, HTML, and JSON rendering\n- **Responsive Design Detection**: Breakpoint analysis and mobile-first patterns\n\n## Installation\n\n```bash\npip install julia-browser\n```\n\n## Quick Start\n\n### Command Line Interface\n\n### Command Line Usage\n\n```bash\n# Browse a website\njulia-browser browse https://example.com\n\n# Start interactive mode\njulia-browser interactive\n\n# Render to different formats\njulia-browser render https://api.github.com --format json\n```\n\n### AI Agent SDK \ud83e\udd16\n\nJulia Browser includes a clean, simple AI Agent SDK that enables AI systems to control websites exactly like humans do - with direct, intuitive functions that mirror CLI browser commands.\n\n> **Perfect for:** Web automation, AI agents, research workflows, data collection, form automation, and human-like web interactions.\n\n#### Simple Functions - Just Like CLI Commands\n\n```python\nfrom julia_browser import AgentSDK\n\n# Initialize AI agent\nagent = AgentSDK()\n\n# Open a website (like CLI 'browse' command)\nresult = agent.open_website(\"https://example.com\")\nprint(f\"Opened: {result['title']}\")\n\n# List interactive elements (like CLI 'elements' command)\nelements = agent.list_elements()\nprint(f\"Found {elements['total_clickable']} clickable elements\")\n\n# Type into input fields (like CLI 'type' command)\nagent.type_text(1, \"search query\")\n\n# Click buttons or links (like CLI 'click' command)\nagent.click_element(1)\n\n# Submit forms (like CLI form submission)\nresult = agent.submit_form()\nprint(f\"Form submitted: {result['title']}\")\n```\n\n#### Complete AI Agent SDK Functions\n\n**Core Website Functions:**\n- `open_website(url)` - Open any website and get page content\n- `list_elements()` - List all clickable elements and input fields with numbers\n- `get_page_info()` - Get current page title, URL, and full content\n- `search_page(term)` - Search for text within the current page\n\n**Human-like Interactions:**\n- `click_element(number)` - Click buttons or links by their number\n- `type_text(field_number, text)` - Type text into input fields by number\n- `submit_form()` - Submit forms with typed data\n- `follow_link(number)` - Navigate to links by their number\n\n#### Real-World Usage Examples\n\n**1. Simple Web Search:**\n```python\nagent = AgentSDK()\n\n# Open search engine\nagent.open_website(\"https://duckduckgo.com\")\n\n# Type search query into first input field\nagent.type_text(1, \"Python programming\")\n\n# Submit the form\nresult = agent.submit_form()\nprint(f\"Search results: {result['title']}\")\n```\n\n**2. Form Automation:**\n```python\nagent = AgentSDK()\n\n# Open a form page\nagent.open_website(\"https://httpbin.org/forms/post\")\n\n# List all available elements\nelements = agent.list_elements()\nprint(f\"Found {elements['total_inputs']} input fields\")\n\n# Fill form fields by number\nagent.type_text(1, \"John Doe\")      # First field\nagent.type_text(2, \"555-1234\")      # Second field\n\n# Submit the completed form\nresult = agent.submit_form()\n```\n\n**3. Website Navigation:**\n```python\nagent = AgentSDK()\n\n# Open website\nagent.open_website(\"https://example.com\")\n\n# List clickable elements\nelements = agent.list_elements()\nfor button in elements['buttons']:\n    print(f\"Button {button['number']}: {button['text']}\")\n\n# Click the first link/button\nresult = agent.click_element(1)\n\n# Search current page for specific content\nsearch = agent.search_page(\"information\")\nprint(f\"Found '{search['search_term']}' {search['matches_found']} times\")\n```\n\n#### AI Agent Response Format\n\nAll AI Agent SDK methods return structured dictionaries with consistent formats:\n\n```python\n{\n    'success': True,\n    'page_title': 'Example Domain',\n    'url': 'https://example.com',\n    'markdown': '# Page Content...',\n    'forms': 1,\n    'buttons': 3,\n    'inputs': 5,\n    'links': 12,\n    'matches_found': 2,\n    'error': None\n}\n```\n\n#### Integration with AI Systems\n\nThe AI Agent SDK is specifically designed for integration with AI frameworks and automation platforms:\n\n**LangChain Integration:**\n```python\nfrom julia_browser import AgentSDK\nfrom langchain.tools import BaseTool\n\nclass JuliaBrowserTool(BaseTool):\n    name = \"julia_browser\"\n    description = \"Navigate and interact with websites\"\n    \n    def _run(self, url: str) -> str:\n        agent = AgentSDK()\n        result = agent.navigate(url)\n        return result['markdown']\n```\n\n**OpenAI Function Calling:**\n```python\nimport openai\nfrom julia_browser import AgentSDK\n\ndef browse_website(url: str):\n    \"\"\"Browse a website and return its content\"\"\"\n    agent = AgentSDK()\n    return agent.navigate(url)\n\n# Register as OpenAI function\nfunctions = [{\n    \"name\": \"browse_website\",\n    \"description\": \"Browse and analyze website content\",\n    \"parameters\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"url\": {\"type\": \"string\", \"description\": \"Website URL to browse\"}\n        }\n    }\n}]\n```\n\n**Autonomous Agent Workflows:**\n```python\n# Multi-step research workflow\nagent = AgentSDK()\n\n# Step 1: Search for information\nagent.navigate(\"https://duckduckgo.com\")\nagent.fill_input(0, \"artificial intelligence trends 2024\")\nagent.submit_form()\n\n# Step 2: Follow first result\nagent.follow_link(0)\n\n# Step 3: Extract specific data\ninsights = agent.search_page(\"machine learning\")\nprint(f\"Found {insights['matches_found']} ML references\")\n\n# Step 4: Continue to related pages\nelements = agent.get_elements()\nif elements['links'] > 0:\n    agent.follow_link(0)  # Follow related link\n```\n\n#### Why Choose Julia Browser AI Agent SDK?\n\n- **\ud83c\udfaf Human-like Interaction**: Functions mirror exactly how humans browse websites\n- **\ud83d\udd22 Simple Numbering**: All elements are numbered - just click_element(1), type_text(1, \"hello\")\n- **\ud83d\udcca Clean Responses**: Consistent JSON responses with success/error handling\n- **\ud83c\udf10 Real Websites**: Handles modern sites with JavaScript, forms, and dynamic content\n- **\ud83d\ude80 Zero Setup**: No browser installation or complex configuration needed\n- **\u26a1 Direct Commands**: Each function does exactly one thing, like CLI commands\n\n## Advanced Features\n\n### Python API\n\n```python\nfrom julia_browser import BrowserEngine, BrowserSDK\n\n# Initialize browser\nsdk = BrowserSDK()\n\n# Browse a website\nresult = sdk.browse_url(\"https://example.com\")\nprint(result['markdown'])\n\n# Interactive CLI\nfrom julia_browser import CLIBrowser\nbrowser = CLIBrowser()\nbrowser.start_interactive_mode()\n```\n\n## Interactive Mode Commands\n\n- `browse <url>` - Navigate to a website\n- `elements` - Show all interactive elements (buttons, links, forms)\n- `click <number>` - Click on numbered elements\n- `type <text>` - Type into input fields\n- `submit` - Submit forms\n- `back/forward` - Navigate browser history\n- `bookmark add <name>` - Save bookmarks\n- `help` - Show all commands\n\n## Advanced Features\n\n### JavaScript Support\n- Full ES6+ compatibility with Mozilla SpiderMonkey\n- React, Vue, Angular framework support\n- Real API calls and network requests\n- Modern browser API simulation\n\n### Web Interaction\n- Smart form handling with real submission\n- File upload support\n- Authentication flows and session management\n- Cookie handling and persistent sessions\n\n### Performance\n- Intelligent caching with SQLite backend\n- Asynchronous request handling\n- Connection pooling and optimization\n- Lazy loading for large websites\n\n## Examples\n\n### Browse and Interact\n```bash\njulia-browser interactive\n> browse github.com\n> elements\n> click 1  # Click login button\n> type username myuser\n> type password mypass\n> submit\n```\n\n### API Integration\n```python\nfrom julia_browser import BrowserSDK\n\nsdk = BrowserSDK()\n\n# Handle JSON APIs\nresult = sdk.browse_url(\"https://api.github.com/users/octocat\")\nuser_data = result['json_data']\n\n# Process forms\nresult = sdk.submit_form(\"https://httpbin.org/post\", {\n    \"username\": \"test\",\n    \"email\": \"test@example.com\"\n})\n```\n\n## Requirements\n\n- Python 3.8+\n- PythonMonkey (Mozilla SpiderMonkey)\n- Rich (terminal formatting)\n- Click (CLI framework)\n- BeautifulSoup4 (HTML parsing)\n- Requests (HTTP client)\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\nContributions welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.\n\n## Links\n\n- [Documentation](https://docs.juliabrowser.com)\n- [GitHub Repository](https://github.com/juliabrowser/julia-browser)\n- [Issue Tracker](https://github.com/juliabrowser/julia-browser/issues)\n- [PyPI Package](https://pypi.org/project/julia-browser/)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A comprehensive Python-based CLI web browser with JavaScript support and modern web compatibility",
    "version": "1.2.0",
    "project_urls": {
        "Bug Reports": "https://github.com/juliabrowser/julia-browser/issues",
        "Changelog": "https://github.com/juliabrowser/julia-browser/blob/main/CHANGELOG.md",
        "Documentation": "https://docs.juliabrowser.com",
        "Homepage": "https://github.com/juliabrowser/julia-browser",
        "Source": "https://github.com/juliabrowser/julia-browser"
    },
    "split_keywords": [
        "browser",
        " cli",
        " terminal",
        " web",
        " html",
        " css",
        " javascript",
        " markdown",
        " scraping",
        " automation",
        " headless",
        " spidermonkey",
        " pythonmonkey",
        " web-browser",
        " command-line",
        " text-based"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f2a0c46279b47420cc38da1ea31eb0fae0ee8d3ecc193159a531c7c8fa23ad3d",
                "md5": "52edabf3f38e4a0a5c59ac693b49297a",
                "sha256": "c29badfdf201b804c86b2985648cce13ae1a7f76d309fecc0a646327723105da"
            },
            "downloads": -1,
            "filename": "julia_browser-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52edabf3f38e4a0a5c59ac693b49297a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 91293,
            "upload_time": "2025-07-26T08:04:43",
            "upload_time_iso_8601": "2025-07-26T08:04:43.090094Z",
            "url": "https://files.pythonhosted.org/packages/f2/a0/c46279b47420cc38da1ea31eb0fae0ee8d3ecc193159a531c7c8fa23ad3d/julia_browser-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "11af6f74a2c520099a1af80dd6cca8951ef71c39bcd34fc225da84a0a6e38052",
                "md5": "14b3cf71090d265c6d92b35194ce20dd",
                "sha256": "8c07767d855424826d472696bd9eb59f80e5ca7949ee13d6793d991050e7c4f2"
            },
            "downloads": -1,
            "filename": "julia_browser-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "14b3cf71090d265c6d92b35194ce20dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 89379,
            "upload_time": "2025-07-26T08:04:44",
            "upload_time_iso_8601": "2025-07-26T08:04:44.408026Z",
            "url": "https://files.pythonhosted.org/packages/11/af/6f74a2c520099a1af80dd6cca8951ef71c39bcd34fc225da84a0a6e38052/julia_browser-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 08:04:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "juliabrowser",
    "github_project": "julia-browser",
    "github_not_found": true,
    "lcname": "julia-browser"
}
        
Elapsed time: 0.81105s