I tried many things but i could not read the value on tag. I look similar examples here and on the different blogs but solution given there didnt solve my problem.
Html is like this on the site :
<div>
<select name="ctl00$ContentPlaceHolder1$ddlCityID" id="ddlCityID">
<option value="">Choose</option>
<option value="14">Roma</option>
<option value="15">Milan</option>
<option value="16">Inter</option>
</select>
</div>
My code on php :
$pageTitle = 'select[@id="ddlCityID"]';
$html = file_get_html($url);
if ($html != null )
{
foreach($html->find($pageTitle) as $element)
{
$link = $element->find('option');
callfunction($link[0]->option);
}
}
Error :
Notice: Undefined offset: 0 in C:\Aptana Studio 3 = a.php on line 57
Notice: Trying to get property of non-object in C:\Aptana Studio 3 = a.php on line 57
Where is my problem and how can i get value of tag, and the text in the tag.
Thanks;