File tree Expand file tree Collapse file tree
examples/cdp_mode/playwright Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,11 +156,12 @@ with sync_playwright() as p:
156156 page = browser.contexts[0 ].pages[0 ]
157157 page.goto(" https://copilot.microsoft.com" )
158158 page.wait_for_selector(" textarea#userInput" )
159- page.wait_for_timeout(1000 )
159+ page.wait_for_timeout(2000 )
160160 query = " Playwright Python connect_over_cdp() sync example"
161161 page.fill(" textarea#userInput" , query)
162+ page.wait_for_timeout(2000 )
162163 page.click(' button[data-testid="submit-button"]' )
163- page.wait_for_timeout( 4000 )
164+ sb.sleep( 5.25 )
164165 sb.solve_captcha()
165166 page.wait_for_selector(' button[data-testid*="-thumbs-up"]' )
166167 page.wait_for_timeout(4000 )
Original file line number Diff line number Diff line change 88with sync_playwright () as p :
99 browser = p .chromium .connect_over_cdp (endpoint_url )
1010 page = browser .contexts [0 ].pages [0 ]
11- page .wait_for_timeout (2800 )
12- continue_button = 'button:has-text("Continue shopping")'
13- if page .locator (continue_button ).count () > 0 :
14- page .click (continue_button )
15- page .click ('input[aria-label="Search"]' )
16- page .wait_for_timeout (1800 )
11+ search_box = 'input[aria-label="Search"]'
1712 search = "Settlers of Catan Board Game"
1813 required_text = "Catan"
19- input_selector = 'input[aria-label="Search"]'
20- search_box = page .locator (input_selector )
21- search_box .press_sequentially (search + "\n " , delay = 80 )
22- page .wait_for_timeout (3200 )
14+ page .wait_for_timeout (1800 )
15+ sb .click (search_box )
16+ page .wait_for_timeout (1200 )
17+ sb .press_keys (search_box , search + "\n " )
18+ sb .sleep (3.8 )
2319 sb .remove_elements ('[data-testid="skyline-ad"]' )
2420 sb .remove_elements ('[data-testid="sba-container"]' )
2521 print ('*** Walmart Search for "%s":' % search )
You can’t perform that action at this time.
0 commit comments