Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
javascript
phantomjs
02get_titletag_jquery_ggl.js
02get_titletag_jquery_ggl.js
/** * Get HTML content from URL * Reach title tag with jQuery selector * jQuery is included from http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js * by page.includeJs() method */ var page = require('webpage').create(), url = 'http://www.mikosoft.info'; page.open(url, function(status) { if(status === 'success') { page.includeJs('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', function(){ console.log('jQuery included...'); var tit = page.evaluate(function() { tit = $('title').text(); return tit; }); console.log('Page title is: '+tit); phantom.exit(); }); } else { console.log('404 Not found: '+url); phantom.exit(); } });
Reload page
Preview
W3C validation
Edit Code
JS Console