-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdouyuJs.js
More file actions
34 lines (24 loc) · 948 Bytes
/
douyuJs.js
File metadata and controls
34 lines (24 loc) · 948 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
var page = require('webpage').create();
page.open('https://www.douyu.com/586808', function(status) {
console.log("Status: du:" + status);
if(status === "success") {
page.render('dusuccess.png');
var t2 = window.setTimeout(hello1,15000);
function hello1(){
console.log("hello1");
var t1 = window.setInterval(hello,1000);
function hello(){
page.render('duexample.png');
var content = page.evaluate(function () {
var element = document.getElementById("js-chat-cont").children[2].children[0].innerText;
return element;
});
// for(var i =0;i<content.children.length;i++){
console.log(content);
// }
}
}
window.clearTimeout(t1);//去掉定时器
}
// phantom.exit();
});