Skip to content

Commit

Permalink
Create get_redirect.py
Browse files Browse the repository at this point in the history
  • Loading branch information
morganbarber authored Feb 2, 2024
1 parent 5ae9c65 commit efd755d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python_news_scraper/get_redirect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# get redirect of url

import requests
from bs4 import BeautifulSoup

def get_redirect(url):
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
redirect = response.url
return redirect

0 comments on commit efd755d

Please sign in to comment.