Skip to content
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

consolidate comparison examples #49

Merged
merged 9 commits into from
Aug 17, 2024
Prev Previous commit
Next Next commit
Update examples/close_cookies/close_cookies.py
Co-authored-by: Sergey Ryabov <944361+colriot@users.noreply.github.com>
  • Loading branch information
rachelnabors and colriot authored Aug 16, 2024
commit 23d7f45601e688cc34f67b9811e3b7332aedabc5
2 changes: 1 addition & 1 deletion examples/close_cookies/close_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False)

# Create a new AgentQL page instance in the browser for web interactions
# Create a new page in the browser and cast it to custom Page type to get access to the AgentQL's querying API
page: Page = browser.new_page() # type: ignore

page.goto(URL)
Expand All @@ -30,10 +30,10 @@
response = page.query_elements(QUERY)

# Check if there is a cookie-rejection button on the page
if response.cookies_form.reject_btn is not None:

Check failure on line 33 in examples/close_cookies/close_cookies.py

View workflow job for this annotation

GitHub Actions / Pre-commit checks

Cannot access attribute "reject_btn" for class "Locator"   Attribute "reject_btn" is unknown (reportAttributeAccessIssue)

# If so, click the close button to reject cookies
response.cookies_form.reject_btn.click()

Check failure on line 36 in examples/close_cookies/close_cookies.py

View workflow job for this annotation

GitHub Actions / Pre-commit checks

Object of type "Locator" is not callable   Attribute "__call__" is unknown (reportCallIssue)

Check failure on line 36 in examples/close_cookies/close_cookies.py

View workflow job for this annotation

GitHub Actions / Pre-commit checks

Cannot access attribute "reject_btn" for class "Locator"   Attribute "reject_btn" is unknown (reportAttributeAccessIssue)

# Wait for 5 seconds to see the browser in action
time.sleep(5)
Expand Down
Loading