3

How to get data from the address bar on python?

There is the code:

url = 'http://api.vkontakte.ru/oauth/authorize?client_id={id}&scope=friends&redirect_uri=' \
      'http://api.vk.com/blank.html&display=page&response_type=token'
webbrowser.open_new_tab(url)

When you run the browser opens to allow the application access to information about friends (or the login form) when we allow, then get a link in the browser like this:

http://api.vk.com/blank.html#access_token={token}&expires_in={exp}&user_id={id}

Well, how to pass {token}, {exp}, {id} in the program?

Sorry, for my bad english :)

Aleks_RT
  • 33
  • 3
  • Have you tried to inspect the HTTP response header? It might give you the actual response url. I'm not sure if it will be foolproof if redirects occur tho. –  Mar 16 '14 at 09:57

1 Answers1

1

I had a similar problem. Try with this: http://learnpythonthehardway.org/book/ex51.html

RustyIguana
  • 125
  • 2
  • 9