Issue
I'm using Selenium in Python and i've got some issues. From a websites, there's a calendar where users have to manually click on the date.
My issue is I'd like to click on a specific date with the Selenium code (.click()). I haven't found the way of selecting a date (for example the 27th) and allow Selenium to click on it.
Thanks for your help !
Below the following html code :
<div class="calendar" style="display: block; top: 515.667px; left: 50px;">
<div class="month dual">
<div class="wrapper">
<header>
<span class="prev arrow" style="display: none;">
<span class="icons-arrow_black_left"></span>
<span class="next arrow" style="display: none;"></span>
<span class="icons-arrow_black_right"></span>
<h1 data-automation-id="12">Décembre 2019</h1>
</header>
<table class="body" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<th>D</th>
<th>L</th>
<th>M</th>
<th>M</th>
<th>J</th>
<th>V</th>
<th>S</th>
</tr>
<div class="calendar" style="display: block; top: 515.667px; left: 50px;">
<div class="month dual">
<div class="wrapper">
<header>
<span class="prev arrow" style="display: none;">
<span class="icons-arrow_black_left"></span>
<span class="next arrow" style="display: none;"></span>
<span class="icons-arrow_black_right"></span>
<h1 data-automation-id="12">Décembre 2019</h1>
</header>
<table class="body" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<th>D</th>
<th>L</th>
<th>M</th>
<th>M</th>
<th>J</th>
<th>V</th>
<th>S</th>
</tr>
<tr>
<td class>1</td>
<td class>2</td>
<td class>3</td>
<td class>4</td>
<td class>5</td>
<td class>6</td>
<td class>7</td>
</tr>
<tr>
<td class>8</td>
<td class>9</td>
<td class>10</td>
<td class>11</td>
<td class>12</td>
<td class>13</td>
<td class>14</td>
</tr>
<tr>
<td class>15</td>
<td class>16</td>
<td class>17</td>
<td class>18</td>
<td class>19</td>
<td class>20</td>
<td class>21</td>
</tr>
<tr>
<td class>22</td>
<td class>23</td>
<td class>24</td>
<td class>25</td>
<td class>26</td>
<td class>27</td>
<td class>28</td>
</tr>
<tr>
<td class>29</td>
<td class>30</td>
<td class>31</td>
Solution
Can you try with:
xpath = '//table/tbody/tr[5]/td[6]'
for 27.th day in month
Answered By - josifoski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.