Warptweet Posted October 16, 2007 Share Posted October 16, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/73408-find-an-url/ Share on other sites More sharing options...
MasterACE14 Posted October 16, 2007 Share Posted October 16, 2007 I don't really understand what you mean sorry ? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/73408-find-an-url/#findComment-370453 Share on other sites More sharing options...
GingerRobot Posted October 16, 2007 Share Posted October 16, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/73408-find-an-url/#findComment-370458 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.