Huang Yen-Chieh
Huang Yen-Chieh

Reputation: 635

How to parse the hashed arguments (with # instead of ?) in url in GAE with python?

I want to parse the access_token from the url which facebook login will redirect to. What I got is the following URL and I'd like to know how to parse it in Google App Engine (GAE).

http://localhost:8080/web/#access_token=aaaa&expires_in=5423

I tried using get, get_all but it returns nothing.

Upvotes: 1

Views: 419

Answers (1)

Insidi0us
Insidi0us

Reputation: 1126

import urlparse
access_token = urlparse.parse_qs(urlparse.urlsplit(url).fragment).get('access_token')

Upvotes: 1

Related Questions