var webPage = require('webpage'); var page = webPage.create();
page.customHeaders = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36', 'Content-Type': 'application/x-www-form-urlencoded' };
var selector = "#dropPutDateRange"; // use proper selector
casper.then(function(){ // check selectd value var selected = this.evaluate(function(selector){ var s = document.querySelector(selector); var o = s.children[s.selectedIndex]; return {value: o.value, text: o.innerHTML}; }, selector);