update
This commit is contained in:
18
fml.py
Normal file
18
fml.py
Normal 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
|
||||
|
Reference in New Issue
Block a user