Reply to this topicStart new topic
Can Open Data Table be created from a HTML table?, beginner
Matthew R
post Nov 16 2009, 10:04 AM
Post #1
Group: Members
Posts: 4



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?
Go to the top of the page
 
+Quote Post
sh1mmer
post Nov 16 2009, 11:44 AM
Post #2
Group: Yahoos
Posts: 107



QUOTE (Matthew R @ Nov 16 2009, 10:04 AM) *
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
Go to the top of the page
 
+Quote Post
Matthew R
post Nov 16 2009, 11:52 AM
Post #3
Group: Members
Posts: 4



Thanks! I take it this is javascript for YQL Execute?
Go to the top of the page
 
+Quote Post
Matthew R
post Nov 16 2009, 01:01 PM
Post #4
Group: Members
Posts: 4



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)
Go to the top of the page
 
+Quote Post
« Next Oldest · YQL · Next Newest »
 

Reply to this topicStart new topic

 



rss YDN Forum RSS feeds

YDN Content Copyright © 2010 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy

Help us continue to improve the Yahoo! Developer Network - Send Your Suggestions