【发布时间】:2021-02-08 12:54:13
【问题描述】:
假设有一个网站,内容如下:
<script type="text/javascript">
const onClick = async (event) => {
var page = window.open('', '_blank');
var url = await someCrypticFunctionality();
page.location.replace(url);
}
</script>
<button type="button" onclick="onClick">Click here</button>
使用 puppeteer 我想访问该页面,单击按钮(到目前为止一切顺利),然后检索 url,最好在请求位于该 URL 的任何内容之前。我该怎么做?
【问题讨论】:
标签: javascript node.js asynchronous web-scraping puppeteer