I'm trying to create a simple script to accept a Discord Invite. I've managed to login to an account however I cannot get it to accept the invite.
I've tried using the XPath aswell as using CSS selector to try and find the button but i'm having no luck (examples seen below).
browser.find_element_by_xpath("/html/body/div[1]/div[2]/div/div/div/div/section/div/button")
browser.find_element_by_class_name('marginTop40-i-78cZ.button-3k0cO7.button-38aScr.lookFilled-1Gx00P.colorBrand-3pXr91.sizeLarge-1vSeWK.fullWidth-1orjjo.grow-q77ONN')
The outer html is:
<button type="button" class="marginTop40-Q4o1tS button-1cRKG6 button-f2h6uQ lookFilled-yCfaCM colorBrand-I6CyqQ sizeLarge-3mScP9 fullWidth-fJIsjq grow-2sR_-F"><div class="contents-3ca1mk">Accept Invite</div></button>
Full XPath:
/html/body/div[1]/div[2]/div/div[1]/div/div/div/section/div/button
I've attached a discord invite link at the bottom of the page as an example.
Any help would be much appreciated.