Created
January 10, 2018 18:51
-
-
Save annacruz/be2f52b9728cb12d3d2f56e2b5700a14 to your computer and use it in GitHub Desktop.
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'); | |
let scrape = async () => { | |
const browser = await puppeteer.launch({headless: false}); | |
const page = await browser.newPage(); | |
await page.goto('http://www.tesouro.gov.br/pt/-/rentabilidade-acumulada') | |
await page.waitFor(100); | |
const result = await page.evaluate(() => { | |
page.click('button[value="Baixar arquivo"]') | |
}) | |
browser.close(); | |
return result; | |
} | |
scrape().then((value) => { | |
console.log(value); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment