Does curl javascript library execute inside pages?

I work with several pages where javascript submits the form when the page loads.

Does the curl library automatically execute javascript on web pages? If yes, then there is a way to return the modified DOM instead of the standard default, which I return with simple curl code.

Here is my current code:

$curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,$url); $buffer = curl_exec_follow($curl_handle,10); curl_setopt($curl_handle,CURLOPT_HEADER, 0); curl_setopt($curl_handle,CURLOPT_FOLLOWLOCATION, 1); $buffer = curl_exec($curl_handle); 
+6
javascript php curl
source share
3 answers

No, it is not. It also does not apply CSS styles.

+13
source share

No. A webpage with embedded JavaScript is actually a program. CURL provides the program source code (HTML and JavaScript), but does not run this program.

To run embedded JavaScript, you need (1) a JavaScript interpreter and (2) the Document Object Model (DOM) for the page.

Browsers have, but PHP does not .

People work on versions of PHP, but their development is a big task.

If this is what you need, you can skip PHP and instead look at creating C ++ code using WebKit.

+2
source share

PHP curl is NOT a complete browser. It is just a library that is used to communicate with servers using HTTP, FTP, etc. It performs neither rendering nor parsing.

+1
source share

All Articles