PHP - Get all images from class with simple html dom parser

I need to get all images from the info box in Wikipedia page. I made this code but it gets all images from the page not only for the info box ,i need some help.
When i remove , from selector i get empty array.


$wikilink = "";

//Wikipedia page to parse
    $html = file_get_html($wikilink);

    $images_array = array();

    foreach ($html->find('table.infobox vcard td, img') as $element) {
        $allimages = strtok($element->src . '|', '|');
        array_push($images_array, $allimages);

at least it has to be table.infobox.vcard because the table has both classes, not nested.

I replaced it but still i get all images, when i remove , again an empty array.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.