Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Short link URL
#4
(Jul-09-2020, 02:14 PM)snippsat Wrote: Can use Requests like this.
import requests

url = 'http://bit.ly/cXEInp'
session = requests.Session()
resp = session.head(url, allow_redirects=True)
print(resp.url)
Output:
https://www.flickr.com/photos/26432908@N00/346615997/sizes/l/

Can you explain what's happening here?
Reply


Messages In This Thread
Short link URL - by Evil_Patrick - Jul-09-2020, 09:56 AM
RE: Short link URL - by nuffink - Jul-09-2020, 02:13 PM
RE: Short link URL - by snippsat - Jul-09-2020, 02:14 PM
RE: Short link URL - by Evil_Patrick - Jul-09-2020, 02:41 PM
RE: Short link URL - by snippsat - Jul-09-2020, 05:02 PM
RE: Short link URL - by steve_shambles - Jul-10-2020, 10:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python how to check short url working? Pyguys 10 4,697 Mar-18-2020, 01:42 AM
Last Post: Pyguys
  get link and link text from table metulburr 5 6,293 Jun-13-2019, 07:50 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020