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

driver.find_element not finding element #1

Open
reddere opened this issue Nov 30, 2022 · 5 comments
Open

driver.find_element not finding element #1

reddere opened this issue Nov 30, 2022 · 5 comments

Comments

@reddere
Copy link

reddere commented Nov 30, 2022

In line 73 in BotInsta.py, its written

emailJettable = driver.find_element_by_xpath('//*[@id="email_addr"]').text

the fact is there is no xpath with //*[@id="email_addr"] which will cause it to throw exception. so I found out the xpath was actually //*[@id="trsh_mail"], but even if it finds the element, somehow it is equal to a string with nothing inside, just like this: ""

How to fix and get the email?

@4b75726169736859
Copy link
Owner

In line 73 in BotInsta.py, its written

emailJettable = driver.find_element_by_xpath('//*[@id="email_addr"]').text

the fact is there is no xpath with //*[@id="email_addr"] which will cause it to throw exception. so I found out the xpath was actually //*[@id="trsh_mail"], but even if it finds the element, somehow it is equal to a string with nothing inside, just like this: ""

How to fix and get the email?

Hi Reddere,
I will try to fix that as soon as possible.

The script was already made a few months ago and it is possible that it is not really up to date.
I've been working on a new version since this morning, it should be out today.

For the script to work properly, it is preferable to use residential proxies because Instagram blocks your IP fairly quickly after several attempts.

@4b75726169736859
Copy link
Owner

The script has been updated.
I couldn't test below line 144 (XPATHs are probably bad):

# Error management (XPATHs are probably bad)

If creating the account worked, it will save it to the corresponding files, but if an error occurs (for example, Instagram asks for verification with a phone number, I don't have anything to bypass that at the moment) it will will also save it to files.

I don't have a residential proxy yet so I can't test; and my IP is ban temp.

I'll update when I can..
But if you have residential proxies, and you test you will surely be able to update the XPATHs and the script will be 100% functional.

@reddere
Copy link
Author

reddere commented Dec 4, 2022

Thanks for the reply! I tried this out and just when I loaded it up I noticed that all the code below the while True statement from 65 and above is unreachable as it is an infinite loop. Also, lately I have been working on a requests bot for instagram account creation, so instead of selenium its just all about headers, payload and requests. Everything is working fine, except that instagram returns:

{
    "account_created": false,
    "errors": {
        "email": [
            {
                "message": "This field is required.",
                "code": "email_required"
            }
        ],
        "username": [
            {
                "message": "This field is required.",
                "code": ""
            }
        ],
        "__all__": [
            {
                "message": "Create a password at least 6 characters long.",
                "code": "too_short_password"
            }
        ]
    },
    "status": "ok",
    "error_type": "form_validation_error"
}

I feel like I am close an inch to figure it all out, wanna collaborate on it together? if so tell me if u got discord. I speak a little of french too :) @4b75726169736859

@4b75726169736859
Copy link
Owner

Thanks for the reply! I tried this out and just when I loaded it up I noticed that all the code below the while True statement from 65 and above is unreachable as it is an infinite loop. Also, lately I have been working on a requests bot for instagram account creation, so instead of selenium its just all about headers, payload and requests. Everything is working fine, except that instagram returns:

{
    "account_created": false,
    "errors": {
        "email": [
            {
                "message": "This field is required.",
                "code": "email_required"
            }
        ],
        "username": [
            {
                "message": "This field is required.",
                "code": ""
            }
        ],
        "__all__": [
            {
                "message": "Create a password at least 6 characters long.",
                "code": "too_short_password"
            }
        ]
    },
    "status": "ok",
    "error_type": "form_validation_error"
}

I feel like I am close an inch to figure it all out, wanna collaborate on it together? if so tell me if u got discord. I speak a little of french too :) @4b75726169736859

Hi reddere, sorry I'm pretty busy right now.
What do you mean by unreachable? not usable or unreachable on Github?

Oh that's interesting, I'm in!
Selenium has a lot of inconveniences.. the XPATHs change often etc...

Add me on discord it would be a good idea to work together on this project. KuraishY#8451

@reddere
Copy link
Author

reddere commented Dec 8, 2022

Good to hear ! Added you on Discord. Reply me there

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