Reputation: 460
I am using simple_html_dom on a webpage of mine to save 3 separate pages and search and print various things within those pages. This makes the page take quite a few seconds to load.
Is there any way that I can optimize simple_html_dom to run faster? Or is there something else I should be using altogether for better speeds? I would think 3 pages isn't that much, but perhaps I am wrong. I guess it's like loading 3 separate pages all at one time — but then, is there anything at all that I can use to make things faster?
Thanks in advance!
Upvotes: 1
Views: 1970
Reputation: 24502
It probably depends on what you search for, i.e., how much DOM scraping the parser needs to do. I recently used simple_html_dom for extracting data from almost a thousand pages, all in a single request, and it took like 10 seconds to process it all.
It might be that the HTTP request takes most of the time. Try fetching the pages to scrape with wget
or whatever's your preferred method, and then run simple_html_dom against files saved to your local hard disc.
Upvotes: 2