diff options
author | luxagraf <sng@luxagraf.net> | 2019-01-13 11:51:02 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-01-13 11:51:02 -0600 |
commit | c4da428fc9ec439389b7473ba5638d9f82085475 (patch) | |
tree | 2c135804e201b3008fe56db25d993881a49da686 /app/utils | |
parent | 120021d565eefa0318c487f0ff5707c7b9893b43 (diff) |
updated income and resume apps
Diffstat (limited to 'app/utils')
-rw-r--r-- | app/utils/util.py | 11 |
1 files changed, 11 insertions, 0 deletions
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 + |