This commit is contained in:
elmo-space
2018-09-01 21:16:07 +02:00
commit 1264c6e322
13 changed files with 1718 additions and 0 deletions

18
fml.py Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/python3
import requests
from bs4 import BeautifulSoup
url = "http://www.fmylife.com/random"
def get_fml(url):
r = requests.get(url)
data = r.text
r.close
soup = BeautifulSoup(data, 'html.parser')
fml = soup.find("article", class_="art-panel").find_all("a")[2].string.strip().replace("\\", "").replace(" FML", "")
del soup
return fml