just an idle curiosity, how would you write a program, maybe in jscript, maybe in another language, to access information from a site and format+display it on another.
-M
Idle curiositybecomes a heavy load
Page 1 of 1
4 Replies - 635 Views - Last Post: 21 February 2008 - 09:57 PM
Replies To: Idle curiosity
#2
Re: Idle curiosity
Posted 21 February 2008 - 11:43 AM
Well you could do an AJAX request except browsers block them from accessing any website but the one it came from. The other way of doing it is creating an invisible iframe with the src as the page with the information you want. Then all you do is read the information, do what you want with it and destroy the iframe.
#3
Re: Idle curiosity
Posted 21 February 2008 - 11:48 AM
Google "page scraping" and the language you want to use.
There are various ways to do it, from simply finding a start and end point on the page and using a mid(start,end,string) type function to display just the part you want, to breaking down the pages DOM and pulling out the part you want.
There are various ways to do it, from simply finding a start and end point on the page and using a mid(start,end,string) type function to display just the part you want, to breaking down the pages DOM and pulling out the part you want.
#4
Re: Idle curiosity
Posted 21 February 2008 - 08:38 PM
ap0c0lyps3, on 21 Feb, 2008 - 11:43 AM, said:
Well you could do an AJAX request except browsers block them from accessing any website but the one it came from. The other way of doing it is creating an invisible iframe with the src as the page with the information you want. Then all you do is read the information, do what you want with it and destroy the iframe.
ok, i think i can work out how to do that, second part of question, how would you format say numbers picked from a site into a table? as simple as storing in vars? not as?
-R
#5
Re: Idle curiosity
Posted 21 February 2008 - 09:57 PM
I would just use a on my page <div id="external_content"></div> and then in javascript i would use the innerHTML property to add html to the div.
Just one more thing, regular expressions are your closest friend when it comes to scraping and text processing. I myself just started using them, I really had no idea how much power they had in them.
http://www.regular-expressions.info
Just one more thing, regular expressions are your closest friend when it comes to scraping and text processing. I myself just started using them, I really had no idea how much power they had in them.
http://www.regular-expressions.info
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|