Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Simple HTML Dom Parser problem: failed to open stream: HTTP request failed! HTTP/1.0 404
d0m1n1k_
post
Post #1





Grupa: Zarejestrowani
Postów: 208
Pomógł: 3
Dołączył: 13.07.2009
Skąd: Tarnów

Ostrzeżenie: (0%)
-----


Witam,
chciałem aby za pomocą poniższego skryptu i biblioteki Simple HTML Dom wyciągnąć linki zgodne z poszukiwanym ze mną schematem.
Mój skrypt:

  1. include('../simple_html_dom.php');
  2. $handle = fopen("_get_links.php", "r");
  3. if($handle){
  4. while(($line = fgets($handle)) !== false){
  5.  
  6. $html = file_get_html($line);
  7. foreach($html->find('a') as $element){
  8. $linkx = $element->href;
  9. if (strpos($linkx,'http://wybrana.domena/produkt/') !== false){
  10. echo $linkx . "<br />";
  11. }
  12. }
  13. }
  14. fclose($handle);
  15. }else{
  16. echo "<br />Error";
  17. }


Pierwsza linijka jest przetwarzana poprawnie.
Niestety, już druga i kolejna nie działa :-//

Wywala następujący błąd:



  1. Warning: file_get_contents( ) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in C:\WebServ\httpd-users\0016-elena_parser\simple_html_dom.php on line 75
  2.  
  3. Fatal error: Call to a member function find() on a non-object in C:\WebServ\httpd-users\0016-elena_parser\app\index.php on line 11


Gdzie:
http://wybrana.domena/produkty/?search%5Bo...Aasc&page=2 - drugi link w pliku _get_links.php
index.php - nazwa pliku ze skryptem
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 10:42