Skip to content

Commit e355e2d

Browse files
committed
Update a CDP Mode example
1 parent 882155a commit e355e2d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

examples/cdp_mode/raw_publication.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
with SB(uc=True, test=True, locale="en", ad_block=True) as sb:
44
url = "https://www.researchgate.net/search/publication"
55
sb.activate_cdp_mode(url)
6-
sb.sleep(2)
7-
if sb.cdp.is_element_visible("p.spacer-bottom"):
8-
sb.uc_gui_click_captcha()
6+
sb.sleep(2.2)
97
shadow_head = "div.main-content div"
108
if sb.is_element_present(shadow_head):
119
sb.cdp.gui_click_element(shadow_head)
1210
sb.sleep(1.5)
13-
sb.cdp.click_if_visible('button[aria-label="Close"]')
14-
sb.cdp.remove_elements('div[class*="ad-container"]')
15-
sb.cdp.remove_elements("div.lite-page-ad")
16-
sb.sleep(0.5)
1711
sb.assert_text("Discover the world's scientific knowledge")
12+
sb.click_if_visible('button[aria-label="Close"]')
1813
sb.highlight('h1[class*="nova"]')
1914
sb.highlight('input[name="q"]')
2015
sb.highlight("a.menu-item.selected")

0 commit comments

Comments
 (0)