I'm trying to use selenium
to click on the expand button on this webpage, which is the plus symbol.
Below is the page source of that elements:
<header>
<ol class="map">
<li class="parent"><a href="../index.html" class="main">Random</a></li>
<li class="parent"><a href="index.html" class="main">16. Brownian Motion</a></li>
<li class="child"><a href="Standard.html" class="main" title="Standard Brownian Motion">1</a></li>
<li class="current">2</li>
<li class="child"><a href="Bridge.html" class="main" title="The Brownian Bridge">3</a></li>
<li class="child"><a href="Geometric.html" class="main" title="Geometric Brownian Motion">4</a></li>
<li class="details"><button type="button" title="Expand Details" onclick="expandDetails(true);"><img src="../icons/Plus.png" alt="Expand" /></button></li>
<li class="details"><button type="button" title="Contract Details" onclick="expandDetails(false);"><img src="../icons/Minus.png" alt="Contract" /></button></li>
</ol>
I think the keys lie in the last 2 lines:
<li class="details"><button type="button" title="Expand Details" onclick="expandDetails(true);"><img src="../icons/Plus.png" alt="Expand" /></button></li>
<li class="details"><button type="button" title="Contract Details" onclick="expandDetails(false);"><img src="../icons/Minus.png" alt="Contract" /></button></li>
I read on 4. Locating Elements, but could not find an appropriate method.
find_element_by_id
find_element_by_name
find_element_by_xpath
find_element_by_link_text
find_element_by_partial_link_text
find_element_by_tag_name
find_element_by_class_name
find_element_by_css_selector
Could you please shed me some lights on this issue?