示唆したようにあなたはDOMを解析することができ。コメントの中で、またはあなたはAJAXを介してコンテンツをリフレッシュするために使用されるJSONレスポンスを利用することができ
これを試してみてください:
$result = json_decode(file_get_contents('https://www.stratisrate.com/json/load/rate.json'), true);
// this will print the whole array under the key 'euro'
print_r($result['euro']);
//This will get you just the value you asked for
print_r($result['euro']['rate']);
JSONレスポンスは次のようになります。
{
"euro": {
"rate_title": "euro",
"rate": "3.37428419",
"strat": 0.296359,
"symbol": "€"
},
"dollar": {
"rate_title": "dollar",
"rate": "3.33987",
"strat": 0.299413,
"symbol": "$"
},
"bitcoin": {
"rate_title": "bitcoin",
"rate": "0.00163",
"strat": 613.496933,
"symbol": "Ƀ"
}
}
これはGoogle Chrome Devツールの[ネットワーク]タブのXHRリクエストを調べると見つかりました。
その後、私は単にそのXHRコールのURLを開いて確認し、その結果(無認証トークンまたはログインが必要です)しまった
DOMDOCUMENTについての記事を読むとhtml – splash58
を解析し、この記事かもしれないが、あなたは、HTTP ...助け:// www.the-art-of-web.com/php/html-xpath-query/ –
@ splash58はすでにそれを試してみましたが、まだそれを理解できません – FluffyMe