Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate that JavaScript is enabled with PHP Curl?

I want to parse the HTML code from a webpage with PHP Curl, but there is an error msg that I can't access the site without JavaScript.

Can I enable JavaScript with PHP Curl?

like image 929
Felix Grunewald Avatar asked Nov 29 '25 17:11

Felix Grunewald


1 Answers

JavaScript is executed by a browser; cURL does not have a JavaScript parser, therefore can not execute it.

Because the website is expecting something to tell it that javascript is enabled, you'll need to use a tool that can execute the webpage through an actual browser to give you the html.

like image 59
simshaun Avatar answered Dec 02 '25 06:12

simshaun