getting date

master
Matt Huntington 2 years ago
parent 24811ad0dc
commit f3e3242b7c

@ -79,14 +79,21 @@ const main = async () => {
try{
selection = selenium.By.css('.full-time-90-days-actuals');
let element = await driver.findElement(selection);
const innerHTML = await element.getAttribute('innerHTML');
let innerHTML = await element.getAttribute('innerHTML');
const percent = parseInt(innerHTML.match(/([0-9]*%)/)[0].replace('%',''))
const url = await driver.getCurrentUrl();
const instanceID = parseInt(url.match(/[0-9]*$/i)[0]);
selection = selenium.By.css('p.course-header__detail');
element = await driver.findElement(selection);
innerHTML = await element.getAttribute('innerHTML');
const graduationDate = new Date(innerHTML.split(' - ')[1]);
if(myInstanceIDs.includes(instanceID)){
console.log("me -->", instanceID, percent);
console.log("me -->", instanceID, graduationDate, percent);
} else {
console.log(instanceID, percent);
console.log(instanceID, graduationDate, percent);
}
} catch (error) {
//console.log(error);

Loading…
Cancel
Save