problem of low data processing speed
Really? IME the DOM parser works quite well. Assuming you have confirmed that this is the cause your woes, then there are 3 obvious solutions:
- if you're scraping multiple pages, shard the workload across all your CPUs
- Use the even based parser instead of the DOM parser (your code gets a lot more complicated at this point) and discard the trailling content you don't need.
- upgrade your hardware
While HTTP supports range queries (i.e. you can fetch only part of page) you don't know where the tag blocks align with the byte stream - so you can't just fetch part of the page.
OTOH if you haven't bothered to check that the problem is with the code execution, then its far more likely that the slowness arises in network latency; you've not told us anything about how you are fetching the pages, and you've not shown us any of the code which retrieves the content (there is "file_get_html" in native PHP).
If the problem is actually latency, then the solution would be to run a batch process to carry out asynchronous fetching of several pages at a time - using curl_multi_exec.