Sha256: c6d469283613460319297d4043dfa1a4341717822755b6365bb711e50b3fa6c0

Contents?: true

Size: 647 Bytes

Versions: 17

Compression:

Stored size: 647 Bytes

Contents

// Find pizza in Mountain View using Yelp

var page = require('webpage').create(),
    url = 'http://lite.yelp.com/search?find_desc=pizza&find_loc=94040&find_submit=Search';

page.open(url, function (status) {
    if (status !== 'success') {
        console.log('Unable to access network');
    } else {
        var results = page.evaluate(function() {
            var list = document.querySelectorAll('address'), pizza = [], i;
            for (i = 0; i < list.length; i++) {
                pizza.push(list[i].innerText);
            }
            return pizza;
        });
        console.log(results.join('\n'));
    }
    phantom.exit();
});

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.11 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js
entangled-0.0.10 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pizza.js