Forum Discussion
AndrewHagaman1
7 years agoQrew Member
Dan,
That is great help. Thank you very much. To take it a step further for example I am trying take the 10yr treasury and directly put it into a field on QB so that I can do calculations with. Any idea on how to do that?
That is great help. Thank you very much. To take it a step further for example I am trying take the 10yr treasury and directly put it into a field on QB so that I can do calculations with. Any idea on how to do that?
- _anomDiebolt_7 years agoQrew EliteYQL uses xpath selectors (not CSS selectors) to index into the html and select nodes. So if that was the only scrap of data you wanted to grab, you could create a pinpoint xpath selector to grab the value in the first table, fourth row, second column:
var site = "http://www.snaprates.com/index.php";
var yql = '
SELECT *
FROM htmlstring
WHERE url='${site}' AND xpath='//section[@id="family1"]//table/tbody/tr[4]/td[2]'
';
var resturl = "https://query.yahooapis.com/v1/public/yql?q="; +
encodeURIComponent(yql) +
"&format=json" +
"&env=store://datatables.org/alltableswithkeys";
$.get(resturl, function(data) {
//console.log(JSON.stringify(data.query.results.result, null, " "))
$("<div id=QBU_dialog>").html(data.query.results.result).dialog();
});
This will result in the following dialog:
To get this value into a table you stuff the valuedata.query.results.result
into a field of the open form or call the API and place it where you want.
This is a very general procedure that can be used to extract data from just about any web page.