Search code examples
seleniumproxyheaderresponseproxy-server

Unable to capture Response Headers Location through browsermob proxy


I'm using selenium php webdriver and php wrapper for browsermob proxy to fetch the access token from facebook. Once the user authetication was sucessfull, the facebook will redirect to

'http://www.karkala.in/index.html#state=ads_management%2Cread_insights&access_token=ABCDEFZCLkK3EBAJOxrzwq0BdXzT6DCA6QDZBbwUpc8ArgdAv5ly3nNSHME9W19cF7a06pGGGyQdkpVtqc4OnZAnAQT4eKDqeaipxLlVEgZDZD&expires_in=5569'

Now I need to read this token. I use the following php code to fetch the response

$har = self::$client->__get("har");

But I'm not able to see the location (above url) in response headers. My response text is available here: http://www.karkala.in/har.txt


Solution

  • Selenium itself has got an option to read the url.

    selenium.GetLocation()
    

    Can be achieved without using browsermob proxy.