0

Can Open Data Table be created from a HTML table?

I see a lot of info on how to generate open data tables from url querystrings but not much on how to create one from an HTML table on a webpage, if indeed that's possible?

by
3 Replies
  • QUOTE (Matthew R @ Nov 16 2009, 10:04 AM) <{POST_SNAPBACK}>
    I see a lot of info on how to generate open data tables from url querystrings but not much on how to create one from an HTML table on a webpage, if indeed that's possible?


    I made a table for that... http://kid666.com/yql/forms2tables.xml
    0
  • Thanks! I take it this is javascript for YQL Execute?
    0
  • I tried the following query and it didn't seem to like it:

    QUOTE
    use "http://kid666.com/yql/forms2tables.xml" as forms2tables; select * from forms2tables where url="http://www.opendatani.info/datafiles/index.html" and xpath="//table[@class='data']/"


    output:
    QUOTE
    <?xml version="1.0" encoding="UTF-8"?>
    <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="0" yahoo:created="2009-11-16T08:57:08Z" yahoo:lang="en-US" yahoo:updated="2009-11-16T08:57:08Z" yahoo:uri="http://query.yahooapis.com/v1/yql?q=use+%22http%3A%2F%2Fkid666.com%2Fyql%2Fforms2tables.xml%22+as+forms2tables%3B+select+*+from+forms2tables+where+url%3D%22http%3A%2F%2Fwww.opendatani.info%2Fdatafiles%2Findex.html%22+and+xpath%3D%22%2F%2Ftable%5B%40class%3D%27data%27%5D%2F%22">
    <diagnostics>
    <publiclyCallable>true</publiclyCallable>
    <url execution-time="119" proxy="DEFAULT"><![CDATA[http://kid666.com/yql/forms2tables.xml]]></url>
    <javascript><![CDATA[Exception: Syntax error(s) [line 1:110 missing EOF at 'data']]]></javascript>
    <javascript execution-time="3" instructions-used="12000" table-name="forms2tables"/>
    <user-time>131</user-time>
    <service-time>119</service-time>
    <build-version>3694</build-version>
    </diagnostics>
    <results/>
    </query>


    I'm not totally clued up on xpath but I think that should get the table i'm after (it's buried inside quite a few divs though but I don't think that should make a difference with the query I passed)
    0

Recent Posts

in YQL