How to click a span with given text using Selenium Python

0 votes

I need to click ALL_USA, you can see in the code below. I need to click a row in a table but unable to do so. My HTML code is below:

<div id="table" arid="1" arwindowid="0" style="height: 299px; width: 638px;">

 <div class="TableHdr" style="visibility: hidden; display: none; width: 638px;">

  <div class="TableInner" style="top: 0px; height: 277px; width: 638px;">

   <div class="BaseTableOuter" draghandler="BaseTable_DragHandler" style="height: 275px; width: 636px;">

    <div class="BaseTableColHeaders" style="width: 636px; left: 0px;">

     <div class="BaseTableInner" style="top: 16px; height: 259px; width: 636px;  overflow-y: auto; overflow-x: hidden;">

      <table id="T1" class="BaseTable" title="" style="width: 2px;">

   <colgroup cols="1">

  <tbody>

        <tr class="hiddentablehdr">

        <tr class="" tabindex="0" arrow="0">

        <tr tabindex="0" arrow="1">

        <tr tabindex="0" arrow="2">

        <tr tabindex="0" arrow="3">

        <tr class="SelPrimary" tabindex="0" arrow="4">

        <td class="BaseTableCellOdd BaseTableCellOddColor BaseTableStaticText" "scope="row" style="width: 636px;">

          <nobr class="dp " style="text-align: left; width: 636px;">

             <span style="padding: 1px 4px;float:left;">ALL_USA</span>

         </nobr>

     </td>

  </tr>

 <tr tabindex="0" arrow="5">

Jul 26, 2018 in Selenium by Martin
• 4,220 points
1,665 views

1 answer to this question.

0 votes
If ALL_USA is subject to change, then you can use:

driver.find_element_by_css_selector("table.BaseTable tr.SelPrimary td span").click();
answered Jul 26, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 11,730 points
108 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
423 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
778 views
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,130 points
279 views
0 votes
1 answer

How to open a browser window in full screen using Selenium WebDriver with C#

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,130 points
3,035 views