finding links in a web page

This is a discussion on "finding links in a web page" within the PHP Forum section. This forum, and the thread "finding links in a web page are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 8th, 2006, 15:11
Junior Member
Join Date: Mar 2006
Age: 21
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
finding links in a web page

Hi

I have been looking for a function that finds links on a web page, i have used get_meta_tags() and file_get_contents() to get data off of a web page and wondered if there was something similar to get URLs. If not what would be simple and logical way to get URLs off a page?
Reply With Quote

  #2 (permalink)  
Old Jul 8th, 2006, 15:30
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: finding links in a web page

Why do you need this function?
Reply With Quote
  #3 (permalink)  
Old Jul 8th, 2006, 16:00
Junior Member
Join Date: Mar 2006
Age: 21
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: finding links in a web page

I'm attempting to write some crawling script, i want to extract and store in MySql all URLs encountered on a web page and then open the file that they point to and repeat the process for a nominal amount of web pages.
Reply With Quote
  #4 (permalink)  
Old Jul 8th, 2006, 17:24
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: finding links in a web page

Regular expressions.

Start here: http://en.wikipedia.org/wiki/Regular_expression
Perhaps try these tutorials: http://www.regular-expressions.info/
Then go hardcore: http://www.regexlib.com/ (only when you know your regexps)

That should get you started, but don't ask me how to run a regular expression in PHP...
I don't know!

[EDITED]
Here you go:
http://www.regular-expressions.info/php.html
http://weblogtoolscollection.com/regex/regex.php
LOL
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)

Last edited by spinal007; Jul 8th, 2006 at 17:33.
Reply With Quote
  #5 (permalink)  
Old Jul 9th, 2006, 11:26
Junior Member
Join Date: Mar 2006
Age: 21
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: finding links in a web page

Cheers Mate, nice one.
Reply With Quote
Reply

Tags
finding, links, web, page

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Links directed to a new page or tab thewebkid Web Page Design 12 Jan 1st, 2008 13:09
links page littlebilly Starting Out 7 Jul 25th, 2007 20:22
Layout for a links page Zonglars Graphics and 3D 12 Jul 22nd, 2007 06:03
links to different points on the same page bruno89 Web Page Design 13 Nov 9th, 2006 00:14
Numbered links to every page dinahdoey Classic ASP 5 Sep 12th, 2004 17:01


All times are GMT. The time now is 02:00.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43