VF
def get_random_quote():
"""
Get random quote and parse text from bash.im
"""
rand_id = random.randint(440000, 445000)
url = "http://bash.im/quote/{}".format(str(rand_id))
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
text = str(soup.find("div", class_="text"))
text = re.sub('<br>', '\n', text)
text = re.sub('<.*?>', '', text)
return url + "\n\n" + text
Может, натолкнет на какие-то мысли