I'm trying to build a bot that will book a class for me when I run it.
But I'm confused about how to proceed.
I'm using Python and Selenium with Chromedriver to load in the page.
The next step is to click the login button, add my data, log in and then navigate the page to find the correct class.
I'm very new to this so it might be very obvious but I can't figure it out.
I'm running this code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
d = webdriver.Chrome()
d.get("http://www.360functionalfitness.se/boka-pass/")
elem = d.find_element_by_name("showLogin")
The following error:
python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="showLogin"]"}
(Session info: chrome=87.0.4280.141)
I've been reading a bunch and still can't figure out how to identify the dang button.
This is the block I think I'm supposed to look at to find the relevant info:
<li ng-if="!member" class="ng-scope">
<a href="" ng-click="showLogin()" toggle-off-canvas=""><i class="fa fa-sign-in"><span class="icon-bg bg-darkgreen"></span></i><span class="ng-binding">Logga in</span></a>
</li>
Any pointers would be extremely helpful.