Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e1c1b2ad6f1abd5362fa to your computer and use it in GitHub Desktop.
Save anonymous/e1c1b2ad6f1abd5362fa to your computer and use it in GitHub Desktop.
Python 3.4.3 (default, Mar 26 2015, 22:03:40)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests, re
>>> resp = requests.get('http://www.tsdxb.com/links/80031')
>>> target_url = re.search("document.location = '([^']*)'", resp.text).group(1)
>>> target_url
'http://t.yhd.com/?tracker_u=1042102010'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment