Reputation:
I am trying to get certain data from a website, though it is not actual text, rather the actual class name of a div (that is where the data I want is stored).
< td id="pdpStoreInventoryStatus_4336" class="store_stock_level out_of_stock">
So my question is how, in PhantomJS, would I go about retrieving this actual data?
Upvotes: 0
Views: 102
Reputation: 16838
var page = require('webpage').create();
page.open('http://example.com/', function() {
var className = page.evaluate(function(){
return document.getElementById("id").className;
});
console.log(className);
phantom.exit();
});
Upvotes: 1