0xfinder / topgg-autovoter

Python program that utilizes the selenium library to vote for bots on top.gg. Supports multiple tokens.
14 stars 3 forks source link

Inconsistencies in timing #8

Open Erickln opened 2 years ago

Erickln commented 2 years ago

In

loginElem = WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.LINK_TEXT, "Login to vote"))
    )
    loginElem.click()
    print('[click] Login to Vote')

crashes, it seems that sometimes it take too long to redirect to to the login page and the program crashes.

However sometimes it works, but it has the same problems in

time.sleep(DELAY)
        browser.refresh()
        # Wait for redirects until authorize page
        WebDriverWait(browser, TIMEOUT).until(
            EC.url_contains('https://discord.com/oauth2/authorize')
        )
        print('[wait] Authorize page')

It seems that it does not detect when the URL properly contains the string

0xfinder commented 2 years ago

if it takes too long to redirect, it could be your internet issue - you can try increasing the timeout which is currently 10s now

for the 2nd part, i just tested and it's working fine for me, if your url you get is different you could try replacing it