Getting the contents of a DIV on another page

Reply

Join Date: May 2008
Posts: 223
Reputation: samarudge is an unknown quantity at this point 
Solved Threads: 18
samarudge samarudge is offline Offline
Posting Whiz in Training

Getting the contents of a DIV on another page

 
0
  #1
Jan 1st, 2009
Hi,
Is there any way to retrieve the contents of a DIV from another website,
E.G.
there is a div on Youtube with the ID description, how would i get the contents of that DIV?
Thanx
Sam Rudge
My Blog, Life and everything that matters to me - SamRudge.co.uk
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 223
Reputation: samarudge is an unknown quantity at this point 
Solved Threads: 18
samarudge samarudge is offline Offline
Posting Whiz in Training

Re: Getting the contents of a DIV on another page

 
0
  #2
Jan 1st, 2009
Sory the info i want 2 get from youtube is in a span not div and the class is description not the id,
Well i think that first post was highly successful and accurate
Sam Rudge
My Blog, Life and everything that matters to me - SamRudge.co.uk
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 45
Reputation: DiGSGRL is an unknown quantity at this point 
Solved Threads: 4
DiGSGRL's Avatar
DiGSGRL DiGSGRL is offline Offline
Light Poster

Re: Getting the contents of a DIV on another page

 
0
  #3
Jan 1st, 2009
Are you looking to write a script to get the contents of a div on another page for you or are you just interested in looking at them yourself?
A little clarification goes a long way.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 223
Reputation: samarudge is an unknown quantity at this point 
Solved Threads: 18
samarudge samarudge is offline Offline
Posting Whiz in Training

Re: Getting the contents of a DIV on another page

 
0
  #4
Jan 2nd, 2009
I want to get the contents of the div and set it as a variable to use in my own script
My Blog, Life and everything that matters to me - SamRudge.co.uk
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: sumchtarek is an unknown quantity at this point 
Solved Threads: 1
sumchtarek sumchtarek is offline Offline
Newbie Poster

Re: Getting the contents of a DIV on another page

 
0
  #5
Jan 2nd, 2009
I am also looking such code
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 45
Reputation: DiGSGRL is an unknown quantity at this point 
Solved Threads: 4
DiGSGRL's Avatar
DiGSGRL DiGSGRL is offline Offline
Light Poster

Re: Getting the contents of a DIV on another page

 
0
  #6
Jan 2nd, 2009
I have not done this yet but I have an idea of how you would need to do it.
First you are going to need to use fopen to open the other page and place the contents of that page into a file for your script to read.
You will then need to search that file for the occurrence of the specific div span element that you are looking for. I hope for your sake that the span you are looking for has a specific name and not just span hehe. Anyways you do the string search find what you are looking for and then slap that into your variable.

Helpful links:
http://us2.php.net/manual/en/function.fopen.php
http://us2.php.net/fread
http://us.php.net/strings

Since I do not know the specifics of what you want to do in terms of finding the term the third link is to all PHP string functions.
A little clarification goes a long way.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 45
Reputation: DiGSGRL is an unknown quantity at this point 
Solved Threads: 4
DiGSGRL's Avatar
DiGSGRL DiGSGRL is offline Offline
Light Poster

Re: Getting the contents of a DIV on another page

 
0
  #7
Jan 2nd, 2009
If it wasn't already obvious to you, you would need to read the source code of the page.
A little clarification goes a long way.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 223
Reputation: samarudge is an unknown quantity at this point 
Solved Threads: 18
samarudge samarudge is offline Offline
Posting Whiz in Training

Re: Getting the contents of a DIV on another page

 
0
  #8
Jan 11th, 2009
Its OK now, thankyou for your help but i use the google/youtube API and found it much easier than searching and opening
My Blog, Life and everything that matters to me - SamRudge.co.uk
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC