1

For the following html:

<ul id="dataset-menu" class="treeview">

<li id="cat_01" class="expandable"></li>
<li id="cat_02" class="collapsable">
    <div class="hitarea collapsable-hitarea"></div>
    <span class="folder" title=""></span>
    <ul style="display: block;">
        <li></li>
        <li>
            <span class="collection">
                <div class="cell">
                    <input id="coll_5555" class="dataset_checkbox" type="checkbox" name="dataset_checkbox" value="5555"></input>
                </div>
                <div class="cell"></div>
            </span>
        </li>
        <li class="last"></li>
    </ul>
</li>
<li id="cat_03" class="expandable"></li>

I have to select the item where the following occurs:

<input id="coll_5555" class="dataset_checkbox" type="checkbox" name="dataset_checkbox" value="5555"></input>

Any idea please?

2
  • Whats problem are you facing here? Commented Mar 20, 2014 at 7:42
  • i could not expand the class to locate the item anyway Commented Mar 20, 2014 at 7:52

1 Answer 1

1

As i understand first you have to click on li with id cat_02 and then click on the checkbox.

driver.find_element_by_css_selector("#cat_02 div.collapsable-hitarea").click()

driver.find_element_by_id("coll_5555").click();
Sign up to request clarification or add additional context in comments.

4 Comments

ElementNotVisibleException: Message: u'Element is not currently visible and so may not be interacted with
when i run the first line code, no error but it does NOT expand the class.
the html code you've provided is from ul (<ul id="dataset-menu" class="treeview">), can you provide its parents html as well?

Your Answer

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