forked from lavina98/SudoCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscrape.js
More file actions
27 lines (22 loc) · 761 Bytes
/
scrape.js
File metadata and controls
27 lines (22 loc) · 761 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
const {PythonShell} = require("python-shell");
let options = {
mode: 'text',
};
PythonShell.run('scrape.py', options, function (err, results) {
if (err) throw err;
console.log('results: ' + results[0]);
});
// let pyshell = new PythonShell('scrape.py', {mode: 'text'});
// pyshell.on('message', function (message) {
// // received a message sent from the Python script (a simple "print" statement)
// console.log(message);
// });
//
// // end the input stream and allow the process to exit
// pyshell.end(function (err,code,signal) {
// if (err) throw err;
// console.log('The exit code was: ' + code);
// console.log('The exit signal was: ' + signal);
// console.log('finished');
// console.log('finished');
// });