This is unreliable... use urlparse:
>>> from urlparse import urlparse
>>> urlparse( 'https://graph.facebook.com/some/path/to/my/resource?some=parameter&some_other=parameter' )
ParseResult(scheme='https', netloc='graph.facebook.com', path='/some/path/to/my/resource', params='', query='some=parameter&some_other=parameter', fragment='')
>>> urlparse( 'https://graph.facebook.com/some/path/to/my/resource?some=parameter&some_other=parameter' ).path
'/some/path/to/my/resource'