From c4da428fc9ec439389b7473ba5638d9f82085475 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 13 Jan 2019 11:51:02 -0600 Subject: updated income and resume apps --- app/utils/util.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/utils') diff --git a/app/utils/util.py b/app/utils/util.py index 6678fc9..714403b 100644 --- a/app/utils/util.py +++ b/app/utils/util.py @@ -110,3 +110,14 @@ def parse_video(s): if soup.find('video'): return True return False + +def parse_reg_bio_page(): + content = requests.get("https://www.theregister.co.uk/Author/Scott-Gilbertson/") + soup = BeautifulSoup(content, 'html.parser') + try: + image = soup.find_all('img')[0]['id'] + img_pk = image.split('image-')[1] + return apps.get_model('photos', 'LuxImage').objects.get(pk=img_pk) + except IndexError: + return None + -- cgit v1.2.3-70-g09d2