Get the content (text) of an URL after Javascript has run with PHP

后端 未结 4 1713
故里飘歌
故里飘歌 2020-11-29 09:08

Is it possible to get the content of a URL with PHP (using some sort of function like file_get_contents or header) but only after the execution of

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 10:06

    I think the easiest and best way is using this package https://github.com/spatie/browsershot just install it completely and use the below code

    Browsershot::url('https://example.com')->bodyHtml()
    

提交回复
热议问题