Non-browser emulation of JavaScript - is it possible?

前端 未结 8 2274
眼角桃花
眼角桃花 2020-12-17 21:13

I have a new project I am working on that involves fetching a webpage, (using PHP and cURL) parsing the HTML and javascript out of it and then handling the data in the resul

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 22:16

    Previously asked here: headless internet browser?

    At Mozilla we get this question a lot. There's no good answer. What you want is a software library that implements pretty much everything a browser needs to do (at least as far as networking, JavaScript, HTML parsing, and the DOM), but with no display.

    The closest thing I know of is HTMLUnit (in Java).

提交回复
热议问题