-
Notifications
You must be signed in to change notification settings - Fork 49
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
unable to locate element xpath #13
Comments
Hi, So the problem with this bot is that it has to be changed with every Instagram update. You will have this: Next, replace line 66: you will probably need to replace all the lines that were changed by instagram (password). Remember, you could also find the wanted element by name but it's easier to right-click copy Xpath and paste it there. Please come back with a feedback for this. Or write further any errors and I'll try to help you. |
Thank you, I will try it later |
Thank you now I can log in, and I also figured out how I can let it close the notification and "save account information" popups. But I still don't know how this comment function works, I changed the explore link to my feed and also to the xpath of the comment line but it says that its unable to locate element |
code.txt |
@arda1984 I'm glad you figured it out. For the comment section try taking the underlying elements from the comment section. Take the textarea element and not the div (since you should write text to it) For example now, the comment textarea element has this xPath: As you can see there are some arrays like this
Waiting for your feedback! |
Hey Radule, so yesterday I fixed the comment line, so now I can log in, close the popups, and like & comment (random comments is also working) on the first post that comes to my feed but how is it going to do the same thing on the next 8 posts and reload the feed page so there will be new posts shown? |
@arda1984 To refresh the page you just have to reload the feed page: To comment and like the other post you have to iterate trough the elements with a The most important line is 30: This line iterates the posts from 1 to 4 like this: As you can see, the last div is increasing with x and the previous with y. These are the post xPath. You have to find the differences between the xPath of the IG posts and change accordingly. Good luck! |
@Radulepy
I did some research and tried to change some lines too but it didn't work |
@Radulepy did you got the notification? :) |
💀 |
@arda1984, so it can't find the element to click (input). Be sure to only add the input (textarea) element to the xPath. |
The only difference between those is the article number where I put the x variable and it still doesn't work |
@Radulepy Sorry but its been a week |
You should have something different depending on the post. Watch out you are pointing to the textarea not the post.
something incrementing will point out that the post is changing. |
@arda1984 Check the latest update |
I get this error when I try to run Instagrambot:
It just opens https://www.instagram.com/accounts/login/?source=auth_switcher with chrome and that's it.
the only thing I've changed is the comments, webdriver dir, and my account info. How can I fix this?
The text was updated successfully, but these errors were encountered: