title: Get requests body using selenium and proxies
body: <p>I want to be able to get a body of the specific subrequest using a selenium behind the proxy.</p>
  
  <p>Now I'm using python + selenium + chromedriver. With logging I'm able to get each subrequest's headers but not body. My logging settings:</p>
  
  <blockquote>
    <p>caps['loggingPrefs'] =
    {'performance': 'ALL',
                            'browser': 'ALL'}</p>
    
    <p>caps['perfLoggingPrefs'] = {"enableNetwork": True,
                                "enablePage": True,
                                "enableTimeline": True}</p>
  </blockquote>
  
  <p>I know there are several options to form a HAR with selenium:</p>
  
  <ul>
  <li>Use geckodriver and <a href="https://github.com/devtools-html/har-export-trigger" rel="nofollow noreferrer">har-export-trigger</a>. I tried to make it work with the following code:</li>
  </ul>
  
  <blockquote>
    <p>window.foo = HAR.triggerExport().then(harLog => { return(harLog); });
    return window.foo;</p>
  </blockquote>
  
  <p>Unfortunately, I don't see the body of the response in the returning data.</p>
  
  <ul>
  <li>Use browsermob proxy. The solution seems totally fine but I didn't find the way to make browsermob proxy work behind the proxy.</li>
  </ul>
  
  <p>So the question is: how can I get the body of the specific network response on the request made during the downloading of the webpage with selenium AND use proxies.</p>
  
  <p>UPD: Actually, with <a href="https://github.com/devtools-html/har-export-trigger" rel="nofollow noreferrer">har-export-trigger</a> I get the response bodies, but not all of them: the response body I need is in json, it's MIME type is 'text/html; charset=utf-8' and it is missing from the HAR file I generate, so the solution is still missing.</p>
  
  <p>UPD2: After further investigation, I realized that a response body is missing even on my desktop firefox when the <a href="https://github.com/devtools-html/har-export-trigger" rel="nofollow noreferrer">har-export-trigger</a> add-on is turned on, so this solution may be a dead-end (<a href="https://github.com/devtools-html/har-export-trigger/issues/31" rel="nofollow noreferrer">issue on Github</a>)</p>
  
  <p>UPD3: This bug can be seen only with the latest version of har-export-trigger. With version 0.6.0. everything works just fine.</p>
  
  <p>So, for future googlers: you may use har-export-trigger v. 0.6.0. or the approach from the accepted answer.</p>