Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Extracting the html tags used on a web page
Old 11-23-2007, 10:16 AM Extracting the html tags used on a web page
fambi's Avatar
Ultra Talker

Posts: 339
Trades: 0
Does anyone have any idea (using preg_match or preg_match_all) on how to look at a web page and see which html tags are being used?

So, looking at this page, the function would return a big array containing h1, h1, p, i, table etc. as its values.

Thanks to anyone that can help.
__________________

Please login or register to view this content. Registration is FREE
from a
Please login or register to view this content. Registration is FREE
is easy!
Read this
Please login or register to view this content. Registration is FREE
that uses our
Please login or register to view this content. Registration is FREE
.
fambi is offline
Reply With Quote
View Public Profile Visit fambi's homepage!
 
 
Register now for full access!
Old 11-23-2007, 11:03 AM Re: Extracting the html tags used on a web page
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Better than using regexp, you should use the php's DOM extension for that:
http://www.php.net/manual/en/ref.dom.php
http://www.bluehatseo.com/guest-post...inks-with-php/
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 11-25-2007, 03:48 AM Re: Extracting the html tags used on a web page
fambi's Avatar
Ultra Talker

Posts: 339
Trades: 0
Thanks.

Do the DOM extensions require the HTML to be valid?
__________________

Please login or register to view this content. Registration is FREE
from a
Please login or register to view this content. Registration is FREE
is easy!
Read this
Please login or register to view this content. Registration is FREE
that uses our
Please login or register to view this content. Registration is FREE
.
fambi is offline
Reply With Quote
View Public Profile Visit fambi's homepage!
 
Old 11-25-2007, 05:05 AM Re: Extracting the html tags used on a web page
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
No:
Quote:
The function parses the HTML contained in the string source. Unlike loading XML, HTML does not have to be well-formed to load.
http://www.php.net/manual/en/functio...t-loadhtml.php
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Extracting the html tags used on a web page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19656 seconds with 12 queries