Spaces:
Runtime error
Runtime error
Commit
·
783cf0a
1
Parent(s):
f43eb18
update playwright
Browse files
app.py
CHANGED
@@ -150,11 +150,13 @@ async def start_playwright_old(question: str):
|
|
150 |
print("-------- Final Answer-----------\n", output_text)
|
151 |
await browser.close()
|
152 |
|
153 |
-
|
154 |
-
pw = async_playwright().start()
|
155 |
-
browser = pw.chromium.launch(headless=True)
|
156 |
-
page = browser.new_page()
|
157 |
-
page.goto("https://basicchatbot.azurewebsites.net/")
|
|
|
|
|
158 |
|
159 |
async def start_playwright(question: str):
|
160 |
# pw = await async_playwright().start()
|
|
|
150 |
print("-------- Final Answer-----------\n", output_text)
|
151 |
await browser.close()
|
152 |
|
153 |
+
async def init_playwright():
|
154 |
+
pw = async_playwright().start()
|
155 |
+
browser = pw.chromium.launch(headless=True)
|
156 |
+
page = browser.new_page()
|
157 |
+
page.goto("https://basicchatbot.azurewebsites.net/")
|
158 |
+
return page
|
159 |
+
page = asyncio.run(init_playwright())
|
160 |
|
161 |
async def start_playwright(question: str):
|
162 |
# pw = await async_playwright().start()
|