I am facing some difficulties scraping a website which uses react.js
and not sure why this is happening.
This is the html of the website:
What I wish to do is click on the button with the class: play-pause-button btn btn -naked
. However, when I load the page with the Mozilla gecko webdriver there is an exception thrown saying
Message: Unable to locate element: .play-pause-button btn btn-naked
which makes me think that maybe I should do something else to get this element? This is my code so far:
driver.get("https://drawittoknowit.com/course/neurological-system/anatomy/peripheral-nervous-system/1332/brachial-plexus---essentials")
# execute script to scroll down the page
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);var lenOfPage=document.body.scrollHeight;return lenOfPage;")
time.sleep(10)
soup = BeautifulSoup(driver.page_source, 'lxml')
print(driver.page_source)
play_button = driver.find_element_by_class_name("play-pause-button btn btn-naked").click()
print(play_button)
Does anyone have an idea as to how I could go about solving this? Any help is much appreciated