Game4all commited on
Commit
b9103a6
·
1 Parent(s): b914272

fix pw not being headless

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -36,14 +36,14 @@ async def api_lifespan(app: FastAPI):
36
  """Lifespan context manager for FastAPI to manage Playwright browser instance."""
37
  global playwright, pw_browser
38
  playwright = await async_playwright().start()
39
- pw_browser = await playwright.chromium.launch(headless=False)
40
 
41
  yield
42
 
43
  await pw_browser.close()
44
  await playwright.stop()
45
 
46
- app = FastAPI(lifespan=api_lifespan)
47
  serp_router = APIRouter(prefix="/serp", tags=["SERP"])
48
  scrap_router = APIRouter(prefix="/scrap", tags=["scrapping"])
49
 
 
36
  """Lifespan context manager for FastAPI to manage Playwright browser instance."""
37
  global playwright, pw_browser
38
  playwright = await async_playwright().start()
39
+ pw_browser = await playwright.chromium.launch(headless=True)
40
 
41
  yield
42
 
43
  await pw_browser.close()
44
  await playwright.stop()
45
 
46
+ app = FastAPI(lifespan=api_lifespan, docs_url="/")
47
  serp_router = APIRouter(prefix="/serp", tags=["SERP"])
48
  scrap_router = APIRouter(prefix="/scrap", tags=["scrapping"])
49