import requests from bs4 import BeautifulSoup # URL of the dream submissions page url = 'https://theofficialdreamcatcher.neocities.org/submit_dream.php' # Fetch the page content response = requests.get(url) # Check if request was successful if response.status_code == 200: # Parse the HTML content soup = BeautifulSoup(response.text, 'html.parser') # Assuming dream submissions are in a specific HTML element (adjust based on actual structure) # Let's say they're inside
(you'll need to inspect the HTML structure) dreams = soup.find_all('div', class_='dream-entry') # Loop through and print out each dream submission for dream in dreams: title = dream.find('h3').text # Assuming each dream has a title in

tag content = dream.find('p').text # Assuming dream content is in

tag print(f'Title: {title}\nContent: {content}\n---\n') else: print('Failed to retrieve the webpage')