laispace/puppeteer-explore

await page.type 不能出错

iWynn opened this issue · 2 comments

iWynn commented

win7 64位,node v8.4.0

(node:4312) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'type' of null
(node:4312) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

iWynn commented

修改标题

iWynn commented

// await page.focus('#lst-ib');
await page.type('#lst-ib','辣子鸡', {
delay: 1000, // 控制 keypress 也就是每个字母输入的间隔
});