1、 Download and install phantomjs according to your own platform https://phantomjs.org/download.html
2、 Call a JS file to access the URL connection that needs to be collected
// Example using HTTP POST operation
"use strict";
var page = require('webpage').create(),
system = require('system'),
server = system.args[1],
settings = {
encoding: "utf8",
headers: {
"Content-Type": "text/html",
"Cookie": "cookie",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
}
};
page.open(server, settings, function (status) {
var content = page.evaluate(function() {
return document.getElementById('uiContent').innerHTML;
});
console.log(content);
phantom.exit();
});
3,
<?php
$url = $_REQUEST['url'];
$command = "phantomjs cread.js " . $url;
@exec($command,$content);
echo $content[0];