Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could write a little <a href="http://datatables.org/" rel="noreferrer">Open Data Table</a> to send out a normal YQL <code>html</code> table query and <em>stringify</em> the result. Something like the following:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"&gt; &lt;meta&gt; &lt;sampleQuery&gt;select * from {table} where url="http://finance.yahoo.com/q?s=yhoo" and xpath='//div[@id="yfi_headlines"]/div[2]/ul/li/a'&lt;/sampleQuery&gt; &lt;description&gt;Retrieve HTML document fragments&lt;/description&gt; &lt;author&gt;Peter Cowburn&lt;/author&gt; &lt;/meta&gt; &lt;bindings&gt; &lt;select itemPath="result.html" produces="JSON"&gt; &lt;inputs&gt; &lt;key id="url" type="xs:string" paramType="variable" required="true"/&gt; &lt;key id="xpath" type="xs:string" paramType="variable" required="true"/&gt; &lt;/inputs&gt; &lt;execute&gt;&lt;![CDATA[ var results = y.query("select * from html where url=@url and xpath=@xpath", {url:url, xpath:xpath}).results.*; var html_strings = []; for each (var item in results) html_strings.push(item.toXMLString()); response.object = {html: html_strings}; ]]&gt;&lt;/execute&gt; &lt;/select&gt; &lt;/bindings&gt; &lt;/table&gt; </code></pre> <hr> <p>You could then query against that custom table with a YQL query like:</p> <pre><code>use "http://url.to/your/datatable.xml" as html.tostring; select * from html.tostring where url="http://finance.yahoo.com/q?s=yhoo" and xpath='//div[@id="yfi_headlines"]/div[2]/ul/li' </code></pre> <hr> <p><strong>Edit:</strong> Just realised this is a pretty old question that was bumped; at least an answer is here, eventually, for anyone stumbling on the question. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload