I am a beginner in scraping and I am using PHP simple_html_dom to scrape data from a website. My current code is not displaying any results. Maybe I don't target proper html tag. Second thing is I need that if there are no results for searched query that code displays message: "Results not found" or something like that. Any help is appreciated.
Here are sample queries:
3lnhl2gc9br764854 1J4FF28SXXL550156
<?php
require "simple_html_dom.php";
$trazi=$_POST['trazi'];
$url="http://lookupvin.com/check/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"VIN=$trazi");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close($ch);
$html = str_get_html($server_output);
foreach($html->find('p.nmar') as $element)
echo $element->innerText();
?>
index.php
<form action="vin.php" method="POST">
<input type="text" name="trazi">
<input type="submit">
</form>
