phantombuster / nickjs

Web scraping library made by the Phantombuster team. Modern, simple & works on all websites. (Deprecated)
https://nickjs.org
ISC License
500 stars 48 forks source link

About sendKeys() #45

Closed msaus closed 6 years ago

msaus commented 6 years ago

Hello there,

Is reset option working?

I found that it is not working and so the previous value is left in the input box.

Here is my code.

await tab.sendKeys('#username', id, {reset:true,keepForcus:false});

Can you confirm that?

OS: Ubuntu 16.04 NickJS: The latest one Google Chrome: 67.0.3396.62

Best regards,

paps commented 6 years ago

Hi, yes, reset is ignored in the case of the Chrome driver. Sorry about that, the documentation is confusing (not to say, totally wrong).

What you can do is clear the field beforehand with an evaluate() call. Does that make sense?

msaus commented 6 years ago

Thanks for quick response.

I see.

Do you think you will fix it up in the future?

If not then, I will use evaluate to clear the input.

regards,

msaus commented 6 years ago

For now, I better use evaluate() function to reset input value. To do that, I did something like this.

await tab.inject(jQuery); await tab.evaluate((arg, callback) => { $('#mytarget').val(""); callback(null); });

paps commented 6 years ago

Great, you got it working? Re-open if not :)