QuestionsData scrapping PHP
mmvikram kumar asked 2 months ago

$url = ‘’;

$doc = new DomDocument;
// We need to validate our document before refering to the id
$doc->validateOnParse = true;


$html = $doc->getElementById(‘city’);
$flag= TRUE;
$content = array();
$i = 0;
$item = array();

foreach($html->getElementsByTagName(‘div’) as $tr) {

Your Answer
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.