Skip to content

TF-2873 Update examples to page.wait_for_timeout() #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions examples/close_cookie_dialog/close_cookies.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""This example demonstrates how to close popup windows (like promotion form) with AgentQL."""

import time

import agentql
from playwright.sync_api import sync_playwright

Expand Down Expand Up @@ -33,7 +31,7 @@ def main():
response.cookies_form.reject_btn.click()

# Wait for 10 seconds to see the browser in action
time.sleep(10)
page.wait_for_timeout(10000)


if __name__ == "__main__":
Expand Down
4 changes: 1 addition & 3 deletions examples/close_cookies/close_cookies.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""This example demonstrates how to close popup windows (like promotion form) with AgentQL."""

import time

import agentql
from playwright.sync_api import sync_playwright

Expand Down Expand Up @@ -34,7 +32,7 @@ def main():
response.cookies_form.reject_btn.click()

# Wait for 10 seconds to see the browser in action
time.sleep(10)
page.wait_for_timeout(10000)


if __name__ == "__main__":
Expand Down
4 changes: 1 addition & 3 deletions examples/close_popup/close_popup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""This example demonstrates how to close popup windows (like promotion form) with AgentQL."""

import time

import agentql
from playwright.sync_api import sync_playwright

Expand Down Expand Up @@ -30,7 +28,7 @@ def main():
# Click the close button to close the popup
response.popup_form.close_btn.click()
# Wait for 10 seconds to see the browser in action
time.sleep(10)
page.wait_for_timeout(10000)


if __name__ == "__main__":
Expand Down
4 changes: 1 addition & 3 deletions examples/first_steps/first_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

"""This is an example of collecting pricing data from e-commerce website using AgentQL."""

import time

# Import the Page class from the AgentQL Playwright extension
# This enables the use of the AgentQL Smart Locator and Data Query API
import agentql
Expand Down Expand Up @@ -95,7 +93,7 @@ def _add_qwilfish_to_cart(page: Page):
qwilfish_page_btn.click()

# Wait for 10 seconds to see the browser action
time.sleep(10)
page.wait_for_timeout(10000)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""This example demonstrates how to save and load a authenticated state (i.e. signed-in state) using AgentQL."""

import time

import agentql
from playwright.sync_api import sync_playwright

Expand Down Expand Up @@ -65,7 +63,7 @@ def load_signed_in_state():
page.wait_for_page_ready_state()

# Wait for 10 seconds to see the signed-in page
time.sleep(10)
page.wait_for_timeout(10000)


if __name__ == "__main__":
Expand Down
Loading