Skip to content

Instantly share code, notes, and snippets.

@Sarverott
Last active December 13, 2023 09:24
Show Gist options
  • Save Sarverott/08403918c5f2aeee973a9750fd6f12c2 to your computer and use it in GitHub Desktop.
Save Sarverott/08403918c5f2aeee973a9750fd6f12c2 to your computer and use it in GitHub Desktop.
# this snippet makes http request to website with random sentence generator
# special thanks for hard work to the creators of "https://randomword.com" - these sentences are great!
from bs4 import BeautifulSoup
import requests
exitflag = False
while not exitflag:
website = requests.get( "https://randomword.com/sentence" )
infosoup = BeautifulSoup( randomMessageWebpage.content, 'html.parser' )
print()
print( infosoup.find( id="random_word" ).string )
print()
exitflag = input("type EXIT to leave~> ").lower() != "exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment