This is HTML page (test.html) The PHP Code here NOTE: i want to get result like this Answer One approach is to use the contextnode parameter to DOMXPath::query to do a subquery on each of the mainid elements for the child subids. Something like this: Note that the trim calls are necessary or you will end up with all of
Tag: scraper
ScraperWiki: How to save html so it only gets loaded once
When I execute a scraper, it loads the url using this method: So every time I add new code to the scraper and want to try it, it loads again the html, which takes a fair amount of time. Is there anyway to save the $html so it’s only loaded the first time? Answer As said on FAQ at docs