I want to be able to cycle through this table's tabs and return the XPATHs and tab names.
I am using the python selenium webdriver.
This is the main container containing all the tabs from which i want the data
When i enter the website into selenium webdriver, i want it to first find this chart_table_container.
<div id="chart_table_container" class="tab_container ui-tabs ui-corner-all ui-widget ui-widget-content">
<ul class="tabs ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header" role="tablist">
Then I want it to cycle through the 3 tabs below, sometimes there might be more than 3. and the XPATH might be different, so I want to automate that.
Is there a way to cycle through the tabs below and return the XPATHs (//*[@id="ui-id-3"]) and also the name of the tabs (First Order) into a dictionary?
This is an example of one tabs
<li role="tab" tabindex="0" class="ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active" aria-controls="chart_wrapper_datatable_first_order" aria-labelledby="ui-id-3" aria-selected="true" aria-expanded="true">
<a href="#chart_wrapper_datatable_first_order" role="presentation" tabindex="-1" class="ui-tabs-anchor" id="ui-id-3">First Order</a></li>
This is another tab
<li role="tab" tabindex="-1" class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" aria-controls="chart_wrapper_datatable_second_order" aria-labelledby="ui-id-4" aria-selected="false" aria-expanded="false">
<a href="#chart_wrapper_datatable_second_order" role="presentation" tabindex="-1" class="ui-tabs-anchor" id="ui-id-4">Second Order</a></li>
This is anothertab
<li role="tab" tabindex="-1" class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" aria-controls="chart_wrapper_datatable_third_order" aria-labelledby="ui-id-5" aria-selected="false" aria-expanded="false">
<a href="#chart_wrapper_datatable_third_order" role="presentation" tabindex="-1" class="ui-tabs-anchor" id="ui-id-5">Third Order</a></li>
Does selenium have the capacity to do this? I looked through the documentation but I only found ways to search for the actual tabs using the XPATHs not find all the XPATHs at once.