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 'focus' of null #1

Open
exiled-serenity opened this issue Mar 1, 2020 · 3 comments
Open

Cannot read property 'focus' of null #1

exiled-serenity opened this issue Mar 1, 2020 · 3 comments

Comments

@exiled-serenity
Copy link

I'm getting this error when I try to use your program, I think there's something wrong with the element handle that pulls the chromium window into focus but I have no idea what that could be.

Error: TypeError: Cannot read property 'focus' of null
    at focusAndType (C:\Users\[Censored Name]\Google Drive\Projects\gpt2\automate-tweetdeck-master\index.js:18:23)
    at logIn (C:\Users\[Censored Name]\Google Drive\Projects\gpt2\automate-tweetdeck-master\index.js:31:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async C:\Users\[Censored Name]\Google Drive\Projects\gpt2\automate-tweetdeck-master\index.js:115:5

Because of this it just opens the window and then doesn't control anything.

@gwpmad
Copy link
Owner

gwpmad commented Mar 5, 2020

Hi @lflad sorry it doesn't work. There's a good chance this project is out of date now (and it was always somewhat buggy) but I'll fire it up again and see if I get the same error as you.

I was trying to solve a problem that I'm not sure was all that solvable. I'll update the readme to reflect that

@exiled-serenity
Copy link
Author

Have you had any luck with this?

@gwpmad
Copy link
Owner

gwpmad commented Mar 11, 2020

Right so I had a look and I get the same problem as you. The issue appears to be that the username and password fields (when logging into Tweetdeck) have changed. They used to have the class names specified here but now those lines of code are returning null because the class names have changed for whatever reason. I think Twitter has redone the login page. The script tells Chromium to focus() on the fields in order to type but it can't focus on null.

I've screenshotted the username element in Chrome Dev Tools for clarity (the password element is below it)
image

This is a buggy program at the best of times and to be honest I don't have a lot of time to fix it at the moment. If you fancy having a go at it yourself and submitting a pull request I'd welcome that. Thanks

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