Home>

Click the "More" button on the page, and click
I want to display an item.



<span>See more faculties, departments and courses</span>

I examined the following code, but the button itself does not disappear, so
Clicking and opening/closing in the same place will be repeated endlessly.

while True:
    try:
        elem = driver.find_element_by_class_name ('__ shi_m_btn_more')
        elem.click ()
    except NoSuchElementException:
        break

I tried to think that it would be possible to respond with the for sentence that you advised.

# We confirmed that you can click the first corresponding element below.
elem = driver.find_element_by_class_name ('__ shi_m_btn_more')
elem.click ()
# #There are four such elements in the page.
elems = driver.find_elements_by_class_name ('__ shi_m_btn_more')
len (elems)
Four
#I want to click on four elements that exist on the page
for elem in elems:
 elem.click ()
# Error occurred
ElementClickInterceptedException: Message: element click intercepted: Element  ...  is not clickable at point (600, 696). Other element would receive the click:  ... 
  (Session info: chrome = 78.0.3904.97)

I would be grateful if you could give me any advice on how to solve it.
Thanks for your cooperation.

  • Answer # 1

    elems = driver.find_elements_by_class_name ('__ shi_m_btn_more')
    for elem in elems:
        ~~~


    Let's examine what changes will occur on the DOM by pressing the

  • Answer # 2

    button that you can go now.
    If you know that, if you confirm in the code that the change has occurred, you should get the next element, and then click again when you have finished.

  • Answer # 3

    I think you can see that this is the last page.
    Let's check it.

Related articles