--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/6097b374-43ed-42b4-81fe-fda3a28b3771%40chromium.org.
Yes it is chrome headless related here is my code
'use strict';
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch({headless: true});
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', request => {
if (request.resourceType() === 'image')
request.abort();
else
request.continue();
});
await page.goto('http://example.com');
const TITLE_PAGE = '.main-title h1';
let innerTitle = await page.evaluate((sel) => {
let html = document.querySelector(sel).innerHTML;
console.log(html);
return html.toString();
}, TITLE_PAGE);
console.log(innerTitle);
await page.waitForSelector(".date-list");
const REAL_TIME = '.date-list';
let innerTimes = await page.evaluate((sel) => {
let arTimes = document.querySelectorAll(sel);
let sTimes = "";
for(var i=0; i<arTimes.length;i++)
{
sTimes += arTimes[i].innerHTML+"|";
}
return sTimes;
}, REAL_TIME);
console.log(innerTimes);
console.log("load page");
/*so far I am printing in CLI*/
/*looking to export these data to php*/
await browser.close();
})();
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/a5847cb3-fe84-4e41-be8e-08b0d200bfab%40chromium.org.
Thank you