Marketing Forums                      

Welcome to the fastest-growing internet marketing forums!

Go Back   Marketing Forums > Webmaster's Lounge > Programming Corner

Programming Corner Anything related to programming... PHP, PERL, ASP, ColdFusion, C++, etc.

Submit Tools Thread Tools Search this Thread Display Modes
Unread 08-10-2009, 02:49 PM   #1
dave's Avatar
Join Date: Oct 2008
iTrader: 0
Referrals: 4
Posts: 525
Reputation: 30
dave is on a distinguished road
Post Quick php script to grab / scrape all the links from a web page

Heres a quick script to grab all the links from a website ( in this case!)

# retrieve the contents of the webpage in your browser

# Then you can parse the html into a dom object
$dom=new DOMDocument();

$xpath=new DOMXPath($dom);
$items = $xpath->query("//a");


for ($i = 0;  $i < $items->length; $i++ ) {
    $item = $items->item($i);
    if($href && $title){
        echo "$href = $title<br/>";
Any requests?

Please read the Rules
dave is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What computer script goes good along with html? EliteTrader HTML & Website Design 13 12-18-2012 06:55 AM
Need Help With Butterfly Script Integrating With Aweber! ray48021 Programming Corner 0 05-20-2011 02:29 PM
Free SEO Tools: Grab now!! sweetashlee SEO - Search Engine Optimization 1 06-13-2010 12:38 PM
WTB : PPC SE using ProSearch Script BossLady Websites For Sale or Wanted 0 11-11-2008 10:42 PM

All times are GMT. The time now is 06:18 AM.

Marketing Forums Homepage
Forum Home
Marketing Forums News
Forum Rules
Forum Statistics

FREE Link Directory
Link Directory Home
Link Exchange Programs
Affiliate Networks
Business Opps
CPM Ad Networks
Contextual Ad Networks
Domain Parking
Paid To Click
Paid To Read
Paid For Action
Paid To Promote
Shopping Rewards
Pay Per Click Programs
PPC Search Engines
Pay Per Sale
Work At Home Opps

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Marketing Forums | This is a Metabin Ltd. Website