So, I want to scrape a class name from a website. Here's the source of html code:
<td title="Complexity" class="cvss6" itemscope itemtype="http://schema.org/Rating">
I want to scrape the "cvss6" only, tried with this:
$nilai1 = explode('<td title="Complexity" class="', $kodeHTML);
$nilai_show2 = explode('" itemscope="', $nilai1[1]);echo "
<tr><td width='85%' align='left' bgcolor='#F5F5F5'>".$judul_show[0]."</td>";
if($nilai_show2[0] == 'cvss6') {
echo "<td width='15%' align='center' bgcolor='#FF0000'>High</td></tr>";
}
but it didn't work, it just won't show anything on my site. I managed to scrape it's html plain text. But how do you scrape a text that is inside the class name? Thanks