Mam jakis problem z pobraniem kodu zrodlowego strony. Zwraca mi blad.
```Fatal error: Uncaught Error: Call to a member function find() on boolean in /home/parafi30/domains/parafiapiotraipawlazlotow.org/public_html/szukanie.php:61 Stack trace: #0 {main} thrown in /home/parafi30/domains/parafiapiotraipawlazlotow.org/public_html/szukanie.php on line 61 ```
include('simple_html_dom.php');
$html = file_get_html('http://parafiapiotraipawlazlotow.org/');
//to fetch all hyperlinks from a webpage
$links = array();
foreach($html->find('a') as $a) {
$links[] = $a->href;
}
print_r($links);
//to fetch all images from a webpage
$images = array();
foreach($html->find('img') as $img) {
$images[] = $img->src;
}
print_r($images);
//to find h1 headers from a webpage
$headlines = array();
foreach($html->find('h1') as $header) {
$headlines[] = $header->plaintext;
}
print_r($headlines);
Probowalem juz tez z "file_get_contents", ale wtedy zwraca puste okno, czyli nic.
Mozecie cos poradzic?