selenium python : find value

22 views
Skip to first unread message

Jitendra Wadle

unread,
Mar 31, 2015, 7:49:28 AM3/31/15
to seleniu...@googlegroups.com
Hi all,

I am stuck please help me.

I am using selenium webdriver using python and try to find out the highlighted value from from below mention html code please help for same 

all_folder = driver.find_element_by_xpath(".//*[@id='tab-editor']/div/div/div/ul")
select_folder = all_folder.find_elements_by_xpath(".//*[@id='tab-editor']/div/div/div/ul/li")
print len(select_folder)
folder_name = driver.find_element_by_class_name("icon-folder-close").text
print "Folder name : %s" % folder_name

Getting null value 

<div class="tabbable">
    <ul class="nav nav-tabs">
               <li data-email-template-folder-id="4" data-is-immutable="0">
                                            <a href="#">
                                                <i class="icon-folder-close"></i>
                                                test
                                                (<span>8</span>)
                                            </a>
                                        </li>

                                        

Xiang Dong

unread,
Mar 31, 2015, 8:43:21 AM3/31/15
to seleniu...@googlegroups.com
The text in <i class="icon-folder-close"></i>  is actually null, you should get text from <a> element.


Date: Tue, 31 Mar 2015 04:49:28 -0700
From: jitend...@gmail.com
To: seleniu...@googlegroups.com
Subject: [selenium-users] selenium python : find value
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f0bf2dec-c83b-4c92-b308-359ad8e9605c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages