-Python- I can’t get redirected link

  python-3.x, python-requests, web-scraping

I want to fetch random scp info with python but it don’t give redirected link. It opens a blank page that writes "Random SCP".

#!/usr/bin/env python

import requests
from bs4 import BeautifulSoup as bs

url = "https://scp-wiki.wikidot.com/random:random-scp"
r = requests.get(url, allow_redirects=True)

print(r.url)

Source: Python-3x Questions

LEAVE A COMMENT