title: how can I use curl with javascript
body: <p>i am using curl to open a page and want to play video using javascript that was shown on the page . i have used following code</p>
  
  <pre><code>$url = "https://www.example.com/";
  $link = "http://www.example.com/oembed?url=" . $url. "&amp;format=json";
  $curl = curl_init($link);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  $return = curl_exec($curl);
  curl_close($curl);
  $result = json_decode($return, true);
  echo '&lt;pre&gt;'; print_r($result);
  echo $result['html'];
  </code></pre>
  
  <p>
      play();</p>
  
  <pre><code>function play(){
  
     document.getElementById("play-button").click();
  }
  </code></pre>
  
  <p></p>
  
  <p>my curl is working but it didn't play the video.where am iI wrong? do i have pass the x-path of the button to play video?</p>