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 a88dc45 commit 7e28edcCopy full SHA for 7e28edc
1 file changed
examples/cdp_mode/raw_cdp_reddit.py
@@ -0,0 +1,16 @@
1
+"""Reddit Search / Bypasses reCAPTCHA."""
2
+from seleniumbase import sb_cdp
3
+
4
+search = "reddit+scraper"
5
+url = f"https://www.reddit.com/r/webscraping/search/?q={search}"
6
+sb = sb_cdp.Chrome(url, use_chromium=True)
7
+sb.solve_captcha() # Might not be needed
8
+post_title = '[data-testid="post-title"]'
9
+sb.wait_for_element(post_title)
10
+for i in range(8):
11
+ sb.scroll_down(25)
12
+ sb.sleep(0.2)
13
+posts = sb.select_all(post_title)
14
+print('*** Reddit Posts for "%s":' % search)
15
+for post in posts:
16
+ print("* " + post.text)
0 commit comments