4b75726169736859 / Insta_Bot_Creator

Python script automating the creation of Instagram accounts in large quantities, using fictitious email addresses
4 stars 2 forks source link

driver.find_element not finding element #1

Open reddere opened 1 year ago

reddere commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

The script has been updated. I couldn't test below line 144 (XPATHs are probably bad): https://github.com/4b75726169736859/Insta_Bot_Creator/blob/c984ab26f1c782e346c62df783bba2e6a8f79476/BotInsta.py#L144

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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