1

I'm trying to scrape a website which requires clicking on "View All" buttons in order to view more items in the html. Problem is, none of the solutions I've been finding through google seem to help/be applicable.

The view-all tab has the class "shelf_view-all', but when I pass this to my driver to find the element, I get an error that it's not interactable.

My code is attached below; does anyone have any thoughts on just getting Selenium to click on this?

from selenium import webdriver
import os
chromedriver = "/usr/local/bin/chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome('/usr/local/bin/chromedriver')
url='https://cn.burberry.com/womens-coats-jackets/#cat3850051'
driver.get(url)
driver.find_element_by_class_name('shelf_view-all').click()
1
  • Update the question with the exact Manual Steps which you are trying to Automate Commented Nov 16, 2018 at 13:51

1 Answer 1

0

class shelf_view-all return 5 element and you select first element which is not correct target, use

find_elements_by_class_name

or css selector

driver.find_elements_by_class_name('shelf_view-all')[4].click()
# or
driver.find_element_by_css_selector('#cat3850051 .shelf_view-all').click()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.