Jump to content

using curl to follow each links on a page ?


jjk2

Recommended Posts

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;
}

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.

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.