schickling / chromeless

🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
https://chromeless.netlify.com
MIT License
13.25k stars 575 forks source link

Retrieve value from input #377

Closed stephanedebove closed 6 years ago

stephanedebove commented 6 years ago

Hello,

I don't understand how I'm supposed to retrieve a value from an input field.

If I use

var title = await chromeless.inputValue('input[name="M_title"]')

it works but then I'm unable to continue my navigation, for instance if I continue my script with .wait(5000) it will return "TypeError: Cannot read property 'wait' of undefined"

adieuadieu commented 6 years ago

@BigNoob which version of Chrome are you using? Are you using the Lambda Proxy Service?

stephanedebove commented 6 years ago

Hi, I'm using Chrome v 63.0.3239.132 and locally, without the proxy service.

I was able to make it work though, I just need to create a new instance of chromeless after that line:

var title = await chromeless.inputValue('input[name="M_title"]')
const screenshot2 = await chromeless
   .wait(5000)

I was hoping I could do something simpler like

var title = .inputValue('input[name="M_title"]')
   .wait(5000)

but I'm ok for now. Thanks!