-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmc.js
More file actions
35 lines (22 loc) · 792 Bytes
/
Copy pathmc.js
File metadata and controls
35 lines (22 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const puppeteer = require('puppeteer');
const path = require('path');
async function run() {
// usual browser startup:
const browser = await puppeteer.launch();
const page = await browser.newPage();
// use absolute paths
//await page.goto("file://home/ec2-user/EXAMPLE/Scrape/data.html");
// use relative paths:
await page.goto(`file:${path.join(__dirname, 'data.html')}`);
const data = await page.evaluate(() => {
const tds = document.body.innerText
return tds
});
const dot = (data.match(/(?<=MC-).*?(?=<)/g) || []);//regEx to find DOT
const mc = (data.match(/(?<=MC-).*?(?=<)/g) || []);//regEc to find MC-
console.log(mc);
//console.log(data);
//console.log(filtered)
browser.close();
}
run();