4 ms·
The query is: select * from html where url="http://news.ycombinator.com/" and xpath='//tr/td/a[substring(@href,1,4)="http"][@href!="http://ycombinator.com"
by chaosmachine 18y ago
The query is:
select * from html where url="http://news.ycombinator.com/" and
xpath='//tr/td/a[substring(@href,1,4)="http"][@href!="http://ycombinator.com"]'
You can play with it yourself here (needs yahoo login):
http://developer.yahoo.com/yql/console/ http://developer.yahoo.com/yql/console/
- Sephr 18y agoYQL isn't that great server-side until they add an `Access-Control-Allow-Origin: *` header. I'm pretty disappointed that they completely disallow Javascript access.
- spullara 18y agoIt offers JSONP instead so you can access any YQL content via Javascript in a browser via script nodes.
- thorax 18y agoYou know, honestly, I wasn't grokking much about how cool YQL could be until I saw this example. This helps a lot. Thanks.
- henning 18y agoI don't get it. Don't queries like that suffer from the same problems as normal screen scraping?
- jfarmer 18y agoYeah, they're obviously brittle, but it's baby steps, y'know? I think it's pretty crazy that you can now scrape well-marked pages with a SQL-like syntax.