dqthn68688
dqthn68688
2019-07-21 15:08

file_get_contents未获取所有内容

已采纳

I try to get content list of CPU compatible with motherboard but the function file_get_contents() returns the page content without CPU list

url='https://www.asrock.com/mb/Intel/Z390%20Phantom%20Gaming%206/index.pl.asp#CPU';
$html = file_get_contents($url);
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • duanmeng9336 duanmeng9336 2年前

    The CPU data is not part of this page. When a user clicks the "CPU" link on the page javascript is executed to get and display this json file: https://www.asrock.com/mb/productGet.asp?cat=CPU&Model=Z390%20Phantom%20Gaming%206

    What you need to do is get this file either server side (PHP) or Client side javascript convert it into a form suitable for display ("decode" the json).

    点赞 评论 复制链接分享

相关推荐