-1

Okay let me preface this by saying that I know next to nothing about HTML. I need to download information from a URL, and print it out onto an HTML webpage. The URL is more-or-less nothing but raw text data. How would I go about extracting the information from the page into my code? I'm sure if I could get even the raw HTML coding into some usable form, I could use Javascript (which I at least somewhat know) to search through it for keywords and print the data out into a readable format. I would just copy-paste the data, but I need it to be able to update it's output as the data changes.

  • All you need is a combination of PHP and HTML to represent the data. With PHP you need to get the data, work with it to parse it to the format you like to have and than output in a HTML form you like to. Your question sounds for me like you want to "steal" data from other pages, doesn't it? This is illegal and they can sue you for many dollars even if you didn't steal anything. Please tell us what you want to do in a detailed way and what your main goal is – Cagatay Ulubay Jun 08 '15 at 15:08
  • The main issue is that I'm not even sure how to correctly ask the question. Rest assured I'm not doing anything illegal or immoral, I just don't wish to share the exact URL I'm using because the information is private – The7Architects Jun 08 '15 at 15:13
  • Then my advice would be to think what you actually want and than split it up in step-by-step introductions like if you want to explain something to someone who has no clue what it is about. E.g. 1) Open XXX 2) At the top position, right under XXX, the YYY looking thing 3) I want this content into my page 4) It should look like YXZ YXZ insteaf of YYY XXX ZZZ 5) If C is 9, than it should stay YYY XXX ZZZ ... and so ~ – Cagatay Ulubay Jun 08 '15 at 15:20

1 Answers1

0

You can use javascript to read contents of the page. Read here. Can Javascript read the source of any web page?

The again if you wish to get some data from some site, check if that site offers the data in JSON format. Its the logical way to read data from another servers. If its your own server, try reading about REST services and how to return data in JSON format. Then you can use GET and POST methods to read data you need.

Community
  • 1
  • 1
Rash
  • 7,677
  • 1
  • 53
  • 74
  • Thank you, this at least gives me some way to start researching what I actually want. I currently know very little about HTML and web programming in general, so I wasn't sure where to even start trying to figure out how to do this. – The7Architects Jun 08 '15 at 15:16
  • No problem. This is a very basic question. But do read about REST and JSON. REST is a bit hard to understand in the beginning but JSON is pretty simple. Also mark the answer as correct if you like it. ^_^ – Rash Jun 08 '15 at 15:17