Today, the boss of the company asked me to grab a WeChat webpage. I used curl to get its json, but I couldn’t get the static html of this webpage. I don’t know how to use this captured json data to display the page. The json package contains the content of the page
————
The json is too long and I can’t post it all directly. I put it on the server. Can you guys help me take a look? Thank you. Been working on this thing for a whole day↓↓↓↓↓
JSON format address
JS file address
Today, the boss of the company asked me to grab a WeChat webpage. I used curl to get its json, but I couldn’t get the static html of this webpage. I don’t know how to use this captured json data to display the page. The json package contains the content of the page
————
The json is too long and I can’t post it all directly. I put it on the server. Can you guys help me take a look? Thank you. Been working on this thing for a whole day↓↓↓↓↓
JSON format address
JS file address
Thank you for the invitation. It means that the data that should be obtained has been successfully obtained, but the html
of this page is in the json
data, right? Can't you parse the corresponding html
from json
? First convert the data format through the json_decode
function of php
, and then extract the html
. Hope it helps you
Post the json data to see if it contains HTML code. If there is html code, append it directly to the HTML browser and it will parse it normally. I just looked at the json data. This should be the data of a list page on the e-commerce website. , can be roughly divided into header data, main content, and footer data. You can convert json into a PHP array and then traverse it, but you need to provide the HTML static and style of the page. This json mainly provides the product information of the page.
You can obtain the json
data
Use json_decode
to decode and extract the html, and then rudely echo
it to the web page or process it before putting it in.