Selenium ElementNotVisibleException: Message: element not interactable












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()









share|improve this question























  • Update the question with the exact Manual Steps which you are trying to Automate

    – DebanjanB
    Nov 16 '18 at 13:51
















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()









share|improve this question























  • Update the question with the exact Manual Steps which you are trying to Automate

    – DebanjanB
    Nov 16 '18 at 13:51














1












1








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()









share|improve this question














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()






python selenium selenium-webdriver






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 1:55









EmalemEmalem

61




61













  • Update the question with the exact Manual Steps which you are trying to Automate

    – DebanjanB
    Nov 16 '18 at 13:51



















  • Update the question with the exact Manual Steps which you are trying to Automate

    – DebanjanB
    Nov 16 '18 at 13:51

















Update the question with the exact Manual Steps which you are trying to Automate

– DebanjanB
Nov 16 '18 at 13:51





Update the question with the exact Manual Steps which you are trying to Automate

– DebanjanB
Nov 16 '18 at 13:51












1 Answer
1






active

oldest

votes


















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()





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53330380%2fselenium-elementnotvisibleexception-message-element-not-interactable%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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()





    share|improve this answer




























      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()





      share|improve this answer


























        0












        0








        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()





        share|improve this answer













        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()






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 2:25









        ewwinkewwink

        12.2k22440




        12.2k22440
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53330380%2fselenium-elementnotvisibleexception-message-element-not-interactable%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine