Hi, I'm trying to implement a screen scrapping scenario on my website and the following set is up to now. What I'm finally trying to do is to replace all the links in the variables of the $ results in which "ResultsDetails.aspx?" For "result-scrape-detail /" then output again can someone tell me in the right direction?
& lt ;? Php $ url = "http: // mysite: 90 / test / label / baggage / resultindex.spand"; $ Raw = file_get_contents ($ url); $ Newlines = array ("\ t", "\ n", "\ r", "\ x20 \ x20", "\ 0", "\ x0B"); $ Content = str_replace ($ neulines, "", html_entity_decode ($ raw)); $ Start = strpos ($ contents, "& lt; div id = 'pageback'"); $ End = strpos ($ content, '& lt; / body & gt;', $ start) + 6; $ Result = substr ($ content, $ start, $ end-$ start); $ Pattern = 'ResultsDetails.aspx?'; $ Replacement = 'result-scrap-detail /'; Preg_replace ($ pattern, $ substitution, $ result); $ Return result; Use a DOM tool such as
With it you can find all the links, Whom you are looking for with a jazzy syntax.
Comments
Post a Comment