Hana Celeste commited on
Commit
19ec652
·
verified ·
1 Parent(s): 0345634

Update app/byps_logic.py

Browse files
Files changed (1) hide show
  1. app/byps_logic.py +4 -4
app/byps_logic.py CHANGED
@@ -1,7 +1,7 @@
1
  import asyncio
2
  import random
3
  from playwright.async_api import async_playwright
4
- from playwright_stealth import stealth_async
5
 
6
 
7
  class BypsApp:
@@ -50,7 +50,8 @@ class BypsApp:
50
 
51
  page = await context.new_page()
52
 
53
- await stealth_async(page)
 
54
 
55
  await page.goto(url, wait_until="domcontentloaded", timeout=60000)
56
 
@@ -81,8 +82,7 @@ class BypsApp:
81
  )
82
  await asyncio.sleep(3)
83
 
84
- content = await page.content()
85
- return {"ok": True, "data": content}
86
 
87
  except Exception as e:
88
  return {"ok": False, "error": str(e)}
 
1
  import asyncio
2
  import random
3
  from playwright.async_api import async_playwright
4
+ from playwright_stealth import stealth
5
 
6
 
7
  class BypsApp:
 
50
 
51
  page = await context.new_page()
52
 
53
+ # ✅ QUAN TRỌNG: KHÔNG await
54
+ stealth(page)
55
 
56
  await page.goto(url, wait_until="domcontentloaded", timeout=60000)
57
 
 
82
  )
83
  await asyncio.sleep(3)
84
 
85
+ return {"ok": True, "data": await page.content()}
 
86
 
87
  except Exception as e:
88
  return {"ok": False, "error": str(e)}