Jump to content

Find an url?


Warptweet

Recommended Posts

I'm trying to read url's off of a website page by reading it's source code and locating http://www.??????.com/???? etc.

 

<embed src="http://www.somewebsite.com/someflash.swf" width="somewidth height="someheight">

 

Is it possible to locate a code in the source of a web page, except the exact link "http://www.somewebsite.com/someflash.swf" can be replaced with like %%%%%%%%%% so it simply finds it's similiar match? Otherwise I need to put in the exact url, and I want to search for all http urls instead.

 

Any tips or ideas on how to accomplish are appreciated.

 

Thanks,

-Warptweet

Link to comment
Share on other sites

Yes, firstly you need to get the contents of the website. In most cases, file_get_contents() will do - though in more complex cases, you'll need to use cURL.

 

Then, you'll need to use regular expressions to find the links: preg_match() or ereg()

 

There's also a sub forum for regex:

 

http://www.phpfreaks.com/forums/index.php/board,43.0.html

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.