We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37f9ee5 commit 64a2b46Copy full SHA for 64a2b46
examples/cdp_mode/raw_reddit.py
@@ -0,0 +1,17 @@
1
+"""Reddit Search / Bypasses reCAPTCHA."""
2
+from seleniumbase import SB
3
+
4
+with SB(uc=True, test=True, use_chromium=True) as sb:
5
+ search = "reddit+scraper"
6
+ url = f"https://www.reddit.com/r/webscraping/search/?q={search}"
7
+ sb.activate_cdp_mode(url)
8
+ sb.solve_captcha() # Might not be needed
9
+ post_title = '[data-testid="post-title"]'
10
+ sb.wait_for_element(post_title)
11
+ for i in range(8):
12
+ sb.scroll_down(25)
13
+ sb.sleep(0.2)
14
+ posts = sb.select_all(post_title)
15
+ print('*** Reddit Posts for "%s":' % search)
16
+ for post in posts:
17
+ print("* " + post.text)
0 commit comments