Created
January 15, 2018 13:40
-
-
Save merrickluo/672b4bf3aecddefcd838f5d9249d8413 to your computer and use it in GitHub Desktop.
4gamer sales screenshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer') | |
| const run = async function () { | |
| const browser = await puppeteer.launch({ | |
| args: ['--no-sandbox'], | |
| }) | |
| const page = await browser.newPage() | |
| await page.goto('http://www.4gamer.net/games/117/G011794/20180111081/') | |
| const games = await page.$("table.SALES_RANKING") | |
| await games.screenshot({ | |
| path: './games.png' | |
| }) | |
| const hardware1 = await page.$('table.SALES_HARDRANKING') | |
| await hardware1.screenshot({ | |
| path: './hardware1.png' | |
| }) | |
| const hardware2 = await page.$('table.SALES_HARDGRAPH') | |
| await hardware2.screenshot({ | |
| path: './hardware2.png' | |
| }) | |
| await browser.close() | |
| } | |
| run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment