jjk2 Posted July 6, 2008 Share Posted July 6, 2008 how can i specify curl to follow each link on a page, and grab a specific results? such as match for all <img> tags ? the first part is only important here. thanks! Quote Link to comment Share on other sites More sharing options...
thatsgreat2345 Posted July 6, 2008 Share Posted July 6, 2008 You will have to use regular expressions to get all the links on the page, and once again use regular expressions to grab the images. You will really just need curl to return the output. this should return all links on the page Function _cLinkCollection($HTML) { preg_match_all('/<a[\s]+.*href[\s]*=[\s]*["\\\']([^"\\\']*)["\\\'].*>(.*)<\/a>/miU' ,$HTML,$ar_Links); Return $ar_Links; } Quote Link to comment Share on other sites More sharing options...
jjk2 Posted July 6, 2008 Author Share Posted July 6, 2008 no.... what i meant was how do i make curl click on links, and get those page contents. i can do the regex stuff.....i am interested in how i can make curl navigate into links, output that page content , and supply cookies if necessary to get into the links. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.