Answer the question
In order to leave comments, you need to log in
Why might a parsing (simple_html_dom) timeout occur?
I'm new to parsing.
The situation calls for using php. I am using php library simple_html_dom.
Connected correctly, the functions are visible.
require_once 'simple_html_dom.php';
$html = file_get_html('http://www.kommersant.ru/');
Answer the question
In order to leave comments, you need to log in
As you said, this is a timeout for the execution of the script by your server.
Try running the script from the command line:
# php parser.php
The second option is to increase the running time of the scripts, but I wouldn't recommend doing that. Parsers are best run from the command line.
In addition, note that this library has a method: $dom = str_get_html($html) (it seems so), respectively, you can first download the page using file_get_contents or Curl and then work with the content. This will help to separate the logic directly into loading and parsing content, which in turn will help to deal with each problem separately.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question