This question probably was worded more complicating than it actually is.
So, basically I am trying to find the "total of column Z" based on reports given to a different website. These reports are given in HTML table form. This website I have no access to. Is it possible, for instance, for me to sum the column of the html table (maybe put in an iframe?) without having access to its source, but while knowing the table ID?
NOTE: I am using HTML, PHP currently (obviously I'm pretty newbie). I don't have much knowledge of java/javascript/jquery, but if it is necessary to complete this task I will learn up! My goal is to send the values of the totals to an Oracle 11g Database, if that makes the problem easier to solve.
I wanted to make sure this is possible before I waste my time trying it. I don't have much time as it is lol.
Example:
Table from "www.website.com"
H1 | H2 | H3 | H4
V1:1 | V1:2 | V1:3 | V1:4
V2:1 | V2:2 | V2:3 | V2:4
V2:1 | V2:2 | V2:3 | V2:4
V2:1 | V2:2 | V2:3 | V2:4
My goal:
$sum1 = <SUM OF ALL V IN COLUMN H2>;
TIA!
If your question is: "Can I fetch an HTML page, parse its contents, calculate a value from them and save that in a database?" then, Yes, this is possible.
The biggest problem might be getting the contents of another page. I don't think you can easily fetch the contents of an IFrame. Maybe the best solution is to fetch the page in PHP (using curl, for instance).
After that, you can decide whether to do the parsing in PHP as well, or use the more powerful jQuery for that. In case of jQuery you might even run it server side if you have node.js. If you don't, you would have to send the contents to your client for parsing, learn jQuery to parse it, and send it back for storing. Doesn't sound too good. I would keep the parsing server side as well.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句