I'm trying to create a script, which signs up on a website, but I am somehow not able to let it click the Sign up for free » button. No error messages or anything at all. The animation looks like the button has been clicked, but the site won't load up the next page.
The HTML source code is as followed: https://i.stack.imgur.com/grqui.png
<div class="main_full_container">
<div id="main" class="main_container content_container">
<div class="flex_container">
<main class="main_content">
<div>
<div>
<form method="post" action="" class="js-register_form">
<input type="hidden" name="register_auth" class="js-register_auth" value="99ce8">
<div>
<div class="login_row">
<div class="login_row__icon">
<svg class="ysvg" style="width: 60px; height:60px"><use xlink:href="/images/93636_0529/bg/icons/sprites/desktop/main/sprite.svg#letter"></use></svg>
</div>
<div class="login_row__text">
<div class="login_row__headline">
Sign up for free!
</div>
<div class="login_row__subheadline">
</div>
</div>
</div>
<div class="flex_row--centered">
<input type="hidden" name="action" value="register">
<a name="Email"></a>
<div class="register__container">
<div class="topmargin">
<label>
<div style="padding:0 3px 3px">E-Mail</div>
<input class="js-register_email" id="email" type="email" name="email" required="" value="">
</div>
<div class="topmargin">
<div class="ysb-pos-middle">
<button class="ysb js-register ysb-highlight" type="submit">Sign up for free »</button>
</div>
</div>
</div>
</div>
<div class="login_alternatives">
<div class="login_alternatives__or"><span>or</span></div>
<div>
<a href="https://accounts.google.com/o/oauth2/">Sign in with Google</a>
</div>
<a class="js-social_media_login_info small" href="#">Meaning</a>
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">document.forms[0].email.focus();</script>
</main>
</div>
</div>
</div>
After I typed in the e-mail through the input field, I want the bot the to click the Sign up for free »
button.
The XPath of the button is:
//*[@id="main"]/div/main/div/div/form/div/div[2]/div/div[2]/div/button
I already tried different things..
Through the normal click-function:
driver.find_element_by_xpath('//*[@id="main"]/div/main/div/div/form/div/div[2]/div/div[2]/div/button').click()
Through "execute script":
driver.execute_script("arguments[0].click();", driver.find_element_by_xpath('//*[@id="main"]/div/main/div/div/form/div/div[2]/div/div[2]/div/button'))
And also tried the solving approaches from this thread: Python Selenium Button Won't Click
(Obviously not at once, but neither of them worked.)
Furthermore adding a sleep time didn't lead to any helpful effects.
I don't get any error messages, except a TimeOut when I use one of the last approaches. The script clicks the button, but nothing happens. Any help is highly appreciated! Thanks in advance