source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/pizza.js@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 647 bytes
Line 
1// Find pizza in Mountain View using Yelp
2
3var page = require('webpage').create(),
4 url = 'http://lite.yelp.com/search?find_desc=pizza&find_loc=94040&find_submit=Search';
5
6page.open(url, function (status) {
7 if (status !== 'success') {
8 console.log('Unable to access network');
9 } else {
10 var results = page.evaluate(function() {
11 var list = document.querySelectorAll('address'), pizza = [], i;
12 for (i = 0; i < list.length; i++) {
13 pizza.push(list[i].innerText);
14 }
15 return pizza;
16 });
17 console.log(results.join('\n'));
18 }
19 phantom.exit();
20});
Note: See TracBrowser for help on using the repository browser.