Search code examples
pythondomweb-scrapingscreen-scrapingsplinter

Find input submit element by multiple class values in Splinter?


I would like to find such element:

<input type="submit" value="login" class="button button-line navy" onclick="...">

I'm using such method but it finds nothing:

browser.find_by_css('.button .button-line .navy').first().click()


Solution

  • browser.find_by_css('.button.button-line.navy').first().click()
    

    As the CSS classes are on the same element, the selector must be without space .button.button-line.navy.

    If there is space in between it will start looking at the child nodes. That's why you were not getting any matches.