I'm teaching myself beautifulsoup and trying to scrape some reddit titles. The list, however, only contains 8 reddit titles. That's weird, since the page contains a lot more reddit titles (I tried saving it). What am I doing wrong and how can I get it to scrape the whole page?
This is my code:
from bs4 import BeautifulSoup as bs
import requests
page = requests.get("https://www.reddit.com/r/RedditWritesSeinfeld/search/?q=flair%3Aprompt&restrict_sr=1&sr_nsfw=&t=all&sort=top")
soup = bs(page.content, 'html.parser')
soupbody = soup.select("div h3") #Selects one element lists of all reddit titles
def listreddittitles(l): #returns a list of all reddit post titles as strings
temp = []
for i in l:
temp.append(i.contents[0])
return temp
reddittitles = listreddittitles(soupbody)
print(len(reddittitles))
input()