This is a discussion on "Extracting info from external web page" within the JavaScript Forum section. This forum, and the thread "Extracting info from external web page are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Extracting info from external web page
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
Extracting info from external web page
Hi all
I am trying to automate a process that enables me to collect the latest National website There is a segment of the page HTML that goes
There is a load of code before this but I have started the code here as the div has an id. Thanks in advance for any help. john |
|
|
|
||||
|
Re: Extracting info from external web page
ok.. here is the process.... Im not going to write it for you but will give you what you need to do.
Firstly, you cant do this in javascript to my knowledge, you would need ASP or PHP. Using fopen (php) or an HTTP request object (ASP) you would need to request the page. Then using a regular expression or splitting the string into an array you would need to isolate this section:- <div id="lottoDraw"> images code here </div> Then you would need to split that section into an array using the following delimeter:- <img src="/player/i/balls/lotto_ What you are left with is an array containing all the draw info. each element of the array will look like this:- 11.gif" alt="ball 11" width="19" height="19" class="lottoball" /> This just leaves you the task of looking for the occurence of .gif .... in code just isolate that and strip it, and everything else after it. Do that for each array element and you are left with your draw info. You will need to handle the bonus ball differerently but should you get this far, you should easy be able to work out that process. Hope this helps.... btw.... once youve decided on a language to use let me know in this thread and i will move it to the appropriate forum.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
Re: Extracting info from external web page
Thanks Rob
It will be php as that is what I premeditatedly use. I have having trouble already though. I get nothing from thye fopen and when I try and get the filesize I get nothing back
John |
|
||||
|
Re: Extracting info from external web page
I'm not totally sure filesize will work on a remote file...
Try using:- $myVar = file_get_contents("http://yoururl");
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
Re: Extracting info from external web page
fopen will not work on external servers. You want PHP's cURL.
__________________
CloudedVision, WebForumz Moderator Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A little help needed - Select info from DB and display on page | weasel | PHP Forum | 3 | Jul 7th, 2007 07:22 |
| How to put your menu/static info. on every page | lmc148 | Starting Out | 18 | Jun 29th, 2007 09:53 |
| need to onclick to open info in div on same page | apster | JavaScript Forum | 2 | Apr 30th, 2007 09:56 |
| Displaying diff info on the same page | waheeddin | Web Page Design | 1 | Feb 23rd, 2007 19:56 |
| Drop down menu info displayed on same page? | Dopeness | JavaScript Forum | 1 | Jan 10th, 2006 07:34 |