I am trying to create a webpage that copies some text that it obtains from other webpages, but I am not sure how to do this.
To give an example:
http site A has a number on it, the wind speed at a particular location at the moment the user loads the page. I know exactly where on the page it will be, like that it will always be the third number on the page, or it will be prefaced by wind speed:, or something else; I have a regular expresion or something that I know will give me what I want from the page, and I have the webpage owner’s permission to use their info or whatever. I want to be able to get this number from the page, and put it on my own webpage.
Is there some way to do this using only HTML? Or do I need to use something else to get the info, like javascript?
Usually pages that offers info to other sites use web services to serve the info.
This way, page like this will have a method on a selected url which you can visit to obtain the info.
Depending on how it’s implemented you could be able to load directly the response of the web service inside your HTML page. However, it’s advisable to use AJAX to make the call to the webservice and manipulate the response.
Of course, if there is no web service available and you’ll strip the info from a plain html text you’ll need definitively javascript to do the task for you, there’s no way to do that just by HTML.