Skip to content

wallach-game/browserWapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser with api access

how to use this tool:

Get the code

git clone https://github.com/wallach-game/browserWapi.git

Set up your routes

Edit routes.py — no rebuild needed, just restart uvicorn inside the container (or docker compose restart).

# routes.py
from fastapi import APIRouter
import app as core

router = APIRouter()

@router.get("/open")
async def open_page():
    page = await core.browser.new_page()
    # open any webpage
    await page.goto("https://example.com")
    # use any Playwright command
    title = await page.title()
    # return the data you want
    return {"title": title}

core.browser is the shared Playwright browser instance.

Run the browser api

docker compose up -d

enjoy this.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors