r = requests.get('https://www.reddit.com/r/wallpapers')
if r.status_code == 200:
    soup = BeautifulSoup(r.text, 'html.parser')
url = str(soup.find_all('a', {'class': 'title'})[1]['href'])
print(url)
Getting the top wallpaper from reddit