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,320 points
7,275 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,910 points

Related Questions In Selenium

0 votes
1 answer

How to perform double click using mouse actions in Selenium with Python?

Hi harsh, you can use ActionChains() class ...READ MORE

answered Jul 29, 2019 in Selenium by Abha
• 28,140 points
2,230 views
0 votes
1 answer

How to Select date from a datepicker with Selenium Webdriver using Python?

Hi Yashim, you can select date from ...READ MORE

answered Jul 31, 2019 in Selenium by Abha
• 28,140 points

edited Oct 7, 2021 by Sarfaraz 10,946 views
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

Installing Selenium Webdriver with Python package

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

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,837 views
0 votes
2 answers

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,500 points
13,673 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,142 views
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,910 points
7,221 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,910 points
2,755 views
0 votes
2 answers

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

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
16,033 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP