Skip to content

Commit 04d04f0

Browse files
committed
Update a CDP Mode example
1 parent f8036a1 commit 04d04f0

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

examples/cdp_mode/raw_kohls.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
from seleniumbase import SB
22

33
with SB(uc=True, test=True, locale="en", incognito=True) as sb:
4-
url = "https://www.kohls.com/"
5-
sb.activate_cdp_mode(url, ad_block=True)
6-
sb.sleep(2.6)
74
search = "Mickey Mouse Blanket"
85
req_1 = "Mickey"
96
req_2 = "Blanket"
10-
if not sb.is_element_present('input[name="search"]'):
11-
sb.refresh()
12-
sb.sleep(2.6)
13-
sb.press_keys('input[name="search"]', search + "\n")
7+
s2 = "+".join(search.split(" "))
8+
q = "?submit-search=web-regular&search=%s" % s2
9+
url = "https://www.kohls.com/search.jsp%s" % q
10+
sb.activate_cdp_mode(url, ad_block=True)
1411
sb.sleep(5)
1512
item_selector = 'div[data-testid*="wallet-wrapper"]'
1613
if not sb.is_element_present(item_selector):

0 commit comments

Comments
 (0)