title: get newtork tab in developer tools programmatically with php or javascript
body: <p>I was wondering if it is possible to retrieve the information I see in the network tab of chrome/firefox with some get request in php or any API in JavaScript.</p>
  
  <p>I have some links, I want to pass each of these links to my script, the script retrieves the "network" data, then I will extract some info from these using some string filters.
  I know how to manipulate strings/arrays once I can get the network tab content stored in a variable.</p>
  
  <p>I'm looking for equivalent of opening developer tools, select network tab, then "copy link address" for the urls I see there.
  I'm trying to get each request url like in this photo.
  <a href="https://i.stack.imgur.com/ZTbfY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZTbfY.png" alt="enter image description here"></a>
  So how do I achieve this?</p>
  
  <p>Edit:</p>
  
  <p>Here's what I tried:</p>
  
  <pre><code>    &lt;?php
  $url = 'https://www.youtube.com/watch?v=rPjJZRWAqkE';
  
  print_r(get_headers($url));
  
  print_r(get_headers($url, 1));
  ?&gt;
  </code></pre>
  
  <p>But this doesn't print the request urls</p>
  
  <p>In js I tried:</p>
  
  <pre><code>var url = "https://www.youtube.com/watch?v=B4-OxOmsqR0";
  
  var req = new XMLHttpRequest();
  req.open('HEAD', url, false);
  req.send(null);
  var headers = req.getAllResponseHeaders();
  
  console.log(headers);
  </code></pre>
  
  <p>But the request was blocked with CORS policy No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  
  <p>Thanks in advance</p>