Spaces:
Runtime error
Runtime error
Commit
·
2b6080b
1
Parent(s):
f7bfe98
update timing
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ async def start_playwright():
|
|
86 |
# print("Content of Web: ", await page.content())
|
87 |
# await page.locator("//button[@class='css-1wi2cd3 e1d2x3se3']").click()
|
88 |
await page.locator("//textarea").press("Enter")
|
89 |
-
await page.wait_for_timeout(
|
90 |
# print("Content of Web: ", await page.content())
|
91 |
# print("output_text 1", await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text())
|
92 |
# output_text = await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text()
|
@@ -97,14 +97,13 @@ async def start_playwright():
|
|
97 |
print("output_text... :", output_text)
|
98 |
|
99 |
if output_text == output_history and '▌' not in output_text:
|
100 |
-
|
101 |
else:
|
102 |
-
await page.wait_for_timeout(
|
103 |
output_history = output_text
|
104 |
-
|
105 |
print("-------- Final Answer-----------\n", output_text)
|
106 |
-
|
107 |
await browser.close()
|
|
|
108 |
|
109 |
|
110 |
# import playsound
|
|
|
86 |
# print("Content of Web: ", await page.content())
|
87 |
# await page.locator("//button[@class='css-1wi2cd3 e1d2x3se3']").click()
|
88 |
await page.locator("//textarea").press("Enter")
|
89 |
+
await page.wait_for_timeout(2000)
|
90 |
# print("Content of Web: ", await page.content())
|
91 |
# print("output_text 1", await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text())
|
92 |
# output_text = await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text()
|
|
|
97 |
print("output_text... :", output_text)
|
98 |
|
99 |
if output_text == output_history and '▌' not in output_text:
|
100 |
+
return output_text
|
101 |
else:
|
102 |
+
await page.wait_for_timeout(500)
|
103 |
output_history = output_text
|
|
|
104 |
print("-------- Final Answer-----------\n", output_text)
|
|
|
105 |
await browser.close()
|
106 |
+
|
107 |
|
108 |
|
109 |
# import playsound
|