{"id":27122914,"url":"https://github.com/ascotai/ppwdump","last_synced_at":"2026-05-06T17:31:34.692Z","repository":{"id":286567228,"uuid":"961781305","full_name":"ascotai/ppwdump","owner":"ascotai","description":"ppwdump turns a prompt into runnable python playwright code and pytest playwright code.  Now supports openai compatible providers, including ollama.","archived":false,"fork":false,"pushed_at":"2025-08-08T01:12:35.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T03:13:43.454Z","etag":null,"topics":["browser-automation","browser-use","ollama","playwright","pytest","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ascotai.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-07T06:45:23.000Z","updated_at":"2025-08-08T01:12:38.000Z","dependencies_parsed_at":"2025-04-09T22:54:39.942Z","dependency_job_id":"eb8af8b6-aa46-4c92-9ca7-2bf568dcd7f1","html_url":"https://github.com/ascotai/ppwdump","commit_stats":null,"previous_names":["ascotai/ppwdump"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ascotai/ppwdump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascotai%2Fppwdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascotai%2Fppwdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascotai%2Fppwdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascotai%2Fppwdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ascotai","download_url":"https://codeload.github.com/ascotai/ppwdump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascotai%2Fppwdump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274408535,"owners_count":25279509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-automation","browser-use","ollama","playwright","pytest","python"],"created_at":"2025-04-07T12:20:38.245Z","updated_at":"2026-05-06T17:31:29.668Z","avatar_url":"https://github.com/ascotai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ppwdump\n\nTry out the new uq3c5 Ollama Modelfile!\n\n## Description\n\n`ppwdump` turns a prompt into runnable python playwright code and pytest playwright code. It uses Playwright, and Browser-use. This project leverages the power of these libraries to interact with web browsers and generate code for various purposes. `ppwdump` should now work with Google Gemini, OpenAI compatible providers and Ollama.\n\nhttps://github.com/user-attachments/assets/566c2711-c3b7-4a5c-8bdc-92557c6b57a9\n\n## Installation Using Virtual Environment\n\nFor a more isolated environment, we recommend using a Python virtual environment. If you are on macOS, follow the instructions in the [Python_Venv_Install.md](Python_Venv_Install.md) file to create and activate a virtual environment using `uv` and then install the dependencies.\n\n## Requirements\n\nTo run this project, you need to have the following dependencies installed:\n\n```plaintext\nbrowser-use\n```\n\nYou can install these dependencies using pip:\n\n```bash\npip install -r requirements.txt\n```\n\nAdditionally, you need to install Playwright's browser binaries by running:\n\n```bash\nplaywright install\n```\n\n## Usage\n\n1. **Run the Main Script**\n\n   The main entry point of the project is `__main__.py`. You can run it directly using Python:\n\n   ```bash\n   cd ../\n   python -m ppwdump\n   ```\n\n2. **Customize Configuration**\n\n   The configuration for the project is located in `config.py`. You can modify the following settings:\n\n   - `ANONYMIZED_TELEMETRY`: Whether to enable anonymized telemetry.\n   - `BROWSER_MODEL_PROVIDER`: Model provider for browser interactions (can be ollama, google, or openai) \n   - `BROWSER_MODEL`: The language model to use for browser interactions.\n   - `CODE_MODEL_PROVIDER`: Model provider for code generation (can be ollama, google, or openai) \n   - `CODE_MODEL`: The language model to use for code generation.\n   - `OLLAMA_HOST`: Host address and port for the Ollama service.\n   - `GOOGLE_API_KEY`: API key for Google's Gemini API.\n   - `OPENAI_API_KEY`: API key for OpenAI compatible providers.\n   - `OPENAI_BASE_URL`: Base URL for the OpenAI compatible provider.\n   - `USE_VISION`: Enable or disable vision feature.\n   - `HEADLESS`: Run the browser in headless mode.\n\n3. **Command Line Options**\n\n   ```bash\n   python -m ppwdump [-h] [--no-out] [--pytest] [--history] [--all] [--headless]\n   ```\n\n   Run the main task with optional outputs. Default behavior: output python code\n\n   options:\n   - `-h, --help`: show this help message and exit\n   - `--no-out`: Output nothing\n   - `--pytest`: Output only pytest code\n   - `--history`: Output only history list\n   - `--all`: Output history list, python code and pytest code\n   - `--headless`: Run the browser in headless mode\n\n## Using ppwdump as a Library\n\nYou can use the `ppwdump` library directly in your own projects. Here's an example of how to do this:\n\n```python\n# example_use.py\n\nimport asyncio\nfrom ppwdump import generate_history_list, generate_playwright_code, generate_pytest_playwright_code\n\nasync def main():\n    model_provider = \"ollama\"\n    my_browser_model = \"msmnew\"\n    my_code_model = \"msmnew\"\n    ollama_host  = \"127.0.0.1:11434\"\n    headless = False\n    use_vision = True\n    task = \"Goto https://www.ecosia.org. Put Giant Panda in the search box. Click on the search button. Click on the link for the Giant Panda Wikipedia page. Finish.\"\n    \n    history_list = await generate_history_list(task, model_provider=model_provider, model=my_browser_model, ollama_host=ollama_host, headless=headless,use_vision=use_vision)\n    \n    playwright_code_content = await generate_playwright_code(history_list, model_provider=model_provider, model=my_code_model, ollama_host=ollama_host)\n    print(\"Playwright Code:\\n\")\n    print(playwright_code_content)\n\n    pytest_playwright_code = await generate_pytest_playwright_code(playwright_code_content, model_provider=model_provider, model=my_code_model, ollama_host=ollama_host)\n    print(\"\\nPytest Playwright Code:\\n\")\n    print(pytest_playwright_code)\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Disable Telemetry\n\n   To disable browser-use telemetry, export the `ANONYMIZED_TELEMETRY` environment variable to `\"false\"` in your shell:\n   - On Windows, run:\n     ```cmd\n     set ANONYMIZED_TELEMETRY=false\n     ```\n   - On macOS and Linux, run:\n     ```bash\n     export ANONYMIZED_TELEMETRY=\"false\"\n     ```\n\n## Contributing\n\nContributions to this project are welcome. Please fork the repository and submit pull requests with your changes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](License) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascotai%2Fppwdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fascotai%2Fppwdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascotai%2Fppwdump/lists"}