Skip to content

Commit

Permalink
added support for src from img tags t9tio#11
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheus da Costa Mesquita committed Feb 2, 2019
1 parent 7df35b2 commit 0e4d841
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,14 @@ app.get('/query', async function(req, res){
const hrefRes = await Runtime.evaluate({
expression: `document.querySelector('${selector}').href`,
});
console.log(innerTextRes, hrefRes)
const srcRes = await Runtime.evaluate({
expression: `document.querySelector('${selector}').src`,
});
return {
// selector,
innerText: innerTextRes.result.value,
href: hrefRes.result.value,
imgSrc: srcRes.result.value
}
});

Expand Down Expand Up @@ -166,7 +169,6 @@ app.get('/query', async function(req, res){
}
}
});

/**
* Sample query:
* req.url: 'https://baidu.com'
Expand Down

0 comments on commit 0e4d841

Please sign in to comment.