Created
November 24, 2020 07:57
-
-
Save seisvelas/8e72ed814937b4fec28805d38c8f4dc5 to your computer and use it in GitHub Desktop.
Script to collect lots of quotes from cockbox.org (VPS site) quote section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
from bs4 import BeautifulSoup | |
quotes = [] | |
for i in range(10_000): | |
try: | |
fp = urllib.request.urlopen("https://www.cockbox.org") | |
cockbytes = fp.read() | |
cockstr = cockbytes.decode("utf8") | |
fp.close() | |
soup = BeautifulSoup(cockstr, features="html.parser") | |
quote = soup.find('blockquote').contents[0].strip() | |
if quote not in quotes: | |
quotes.append(quote) | |
except: # Just ignore errors :o :D <3 | |
pass | |
print(quotes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO: