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

Link to comment
Share on other sites

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.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.