Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'click' of undefined #80

Open
tbredillet opened this issue Jan 20, 2022 · 7 comments
Open

Cannot read property 'click' of undefined #80

tbredillet opened this issue Jan 20, 2022 · 7 comments

Comments

@tbredillet
Copy link

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

@mifi
Copy link
Owner

mifi commented Jan 21, 2022

are you running latest version?

there was a recent improvement for language selection in 8a84da9 mifi/SimpleInstaBot#28

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

@tbredillet
Copy link
Author

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

@mifi
Copy link
Owner

mifi commented Jan 21, 2022

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"...

if (elementHandles.length < 1) throw new Error('Language selector not found');

@tbredillet
Copy link
Author

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
Copy link
Owner

mifi commented Jan 21, 2022

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

@tbredillet
Copy link
Author

For me, yes

@mifi
Copy link
Owner

mifi commented Sep 27, 2022

is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants