I try to get from external site’s html source the line v4.0 with A2DP founded after Yes, and , .
In other cases v4.0 with A2DP could have other values but it is always betwen Yes, and ,
This is the external source of html:
<tr>
<td class="ttl"><a href="glossary.php3?term=wi-fi">WLAN</a></td>
<td class="nfo">Wi-Fi 802.11 a/b/g/n, dual-band, DLNA, Wi-Fi Direct, Wi-Fi hotspot</td>
</tr>
<tr>
<td class="ttl"><a href="glossary.php3?term=bluetooth">Bluetooth</a></td>
<td class="nfo">Yes, v4.0 with A2DP, LE, EDR</td>
</tr>
<tr>
<td class="ttl"><a href="glossary.php3?term=nfc">NFC</a></td>
<td class="nfo">Yes</td>
</tr>
I am using this code:
<?php
include_once('/simple_html_dom.php');
$dom = file_get_html("http://www.gsmarena.com/pantech_vega_no_6-5268.php");
foreach ($dom->find('tr') as $node) {
if (is_a($node->children(0), 'simple_html_dom_node')) {
if ($node->children(0)->plaintext == "Bluetooth") {
echo $node->children(1)->plaintext;
}
}
}
?>
And I’m getting all line of bluetooth:
Yes, v4.0 with A2DP, LE, EDR
Try changing your code like this: