php - Simple html dom parser - nothing happens

335

I'd like to parse a HTML site via HTML dom parser. My simple code is:

<?php
    require_once 'simple_html_dom.php';
    $html = new simple_html_dom();
    $html->load_file('http://google.de/');
    echo $html->find('img',0)->getAttribute('src');    
?>

I've got thesimple_html_dom.php file on my server but when I access the PHP file nothing happens. Blank screen! I tried many different codes, I think the problem is not the code. Do I have to install dom-parser on my server or do I have to have a certain version?

People are also looking for solutions to the problem: Requesting file via PHP fails, but succeeds in Python

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.