mifi / instauto

Instagram bot / automation library written in Javascript for Node.js
799 stars 145 forks source link

Cannot read property 'click' of undefined #80

Open tbredillet opened 2 years ago

tbredillet commented 2 years ago

Instauto can't change language when you use another than English, so can't click on "Log In" button

mifi commented 2 years ago

are you running latest version?

there was a recent improvement for language selection in https://github.com/mifi/instauto/commit/8a84da9cd10a8f63fec3e0e6f2c398afd52e2d8c https://github.com/mifi/SimpleInstaBot/issues/28

Do you see anything being logged? or do you see it trying to change language?

tbredillet commented 2 years ago

Yes, I must change the selector by this one : //select/option[@value='${short}' and text()='${long}']

mifi commented 2 years ago

what exactly did you change, this line?

- const elementHandles = await page.$x(`//select[//option[@value='${short}' and text()='${long}']]`);
+ const elementHandles = await page.$x(`//select/option[@value='${short}' and text()='${long}']`);

why is that exactly? you never got the error "Language selector not found"... https://github.com/mifi/instauto/blob/1adf00af98ace2d9c3b17340e96a1d1149c50510/index.js#L809

tbredillet commented 2 years ago

Yes I have this error sometimes, so I went on xpath debugger and this line worked, so I edited this line and instauto work fine

mifi commented 2 years ago

so after that instauto was able to change the langauge to english by itself?

tbredillet commented 2 years ago

For me, yes

mifi commented 1 year ago

is this still an issue?