質問編集履歴
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,60 +10,4 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
```index.js
|
14
|
-
|
15
|
-
const puppeteer = require('puppeteer');
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
exports.getTrends = async (req, res) => {
|
20
|
-
|
21
|
-
console.log('start');
|
22
|
-
|
23
|
-
|
13
|
+
解決しそうなので、コードを消します。
|
24
|
-
|
25
|
-
const browser = await puppeteer.launch({
|
26
|
-
|
27
|
-
headless: true,
|
28
|
-
|
29
|
-
});
|
30
|
-
|
31
|
-
const page = await browser.newPage();
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
await page.goto("https://qiita.com/yoshi0518/items/0685700861fb7fd3f97b", {waitUntil: "domcontentloaded"});
|
36
|
-
|
37
|
-
console.log(await page.title());
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
// ブラウザを閉じる
|
42
|
-
|
43
|
-
await browser.close();
|
44
|
-
|
45
|
-
};
|
46
|
-
|
47
|
-
```
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
```package.json
|
54
|
-
|
55
|
-
{
|
56
|
-
|
57
|
-
"name": "sample-http",
|
58
|
-
|
59
|
-
"version": "0.0.1",
|
60
|
-
|
61
|
-
"dependencies": {
|
62
|
-
|
63
|
-
"puppeteer": "2.1.1"
|
64
|
-
|
65
|
-
}
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
```
|