How to select html tr elements with a specific td class - selenium

I am using selenium to scrape a website, the website has a calendar and i want to get the days out of that calendar that have available times. I have inspected the calendar and found these elements
<table class="ui-datepicker-calendar">
<thead>
<tr>
<th scope="col"><span title="Monday">Mån</span></th>
<th scope="col"><span title="Tuesday">Tis</span></th>
<th scope="col"><span title="Wednesday">Ons</span></th>
<th scope="col"><span title="Thursday">Tor</span></th>
<th scope="col"><span title="Friday">Fre</span></th>
<th scope="col" class="ui-datepicker-week-end"><span title="Saturday">Lör</span></th>
<th scope="col" class="ui-datepicker-week-end"><span title="Sunday">Sön</span></th>
</tr>
</thead>
<tbody>
<tr>
<td class=" ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">29</span></td>
<td class=" ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">30</span></td>
<td class=" ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">31</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">1</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">2</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">3</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">4</span></td>
</tr>
<tr>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">5</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">6</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">7</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">8</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">9</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">10</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">11</span></td>
</tr>
<tr>
<td class=" unavailable ui-datepicker-today" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default ui-state-highlight" href="#">12</a></td>
<td class=" available" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">13</a></td>
<td class=" available" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">14</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">15</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">16</a></td>
<td class=" ui-datepicker-week-end unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">17</a></td>
<td class=" ui-datepicker-week-end unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">18</a></td>
</tr>
<tr>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">19</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">20</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">21</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">22</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">23</a></td>
<td class=" ui-datepicker-week-end unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">24</a></td>
<td class=" ui-datepicker-week-end unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">25</a></td>
</tr>
<tr>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">26</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">27</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">28</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">29</a></td>
<td class=" unavailable" data-handler="selectDay" data-event="click" data-month="8" data-year="2022"><a class="ui-state-default" href="#">30</a></td>
<td class=" ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">1</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled unavailable"><span class="ui-state-default">2</span></td>
</tr>
</tbody>
</table>
as you can see the days that have times available have td class= " available" those are the days I want to save and keep in a list.
I have managed to get the day number printed out so I seem to have all the rows saved as elements since when I do
avail = driver.find_elements(By.CLASS_NAME,"ui-datepicker-calendar")
for elem in avail:
print(elem.text)
the output I get is 29,30,31,1,2,3,4...
How do I only save the rows that have td class= " available"?

UPD
Since the parent td class may contain additional class names we can use contains instead of equals and use not to exclude unavailable dates. As following:
avail = driver.find_elements(By.XPATH,"//td[not(contains(#class,'unavailable'))]//a[#class='ui-state-default']")
for elem in avail:
print(elem.text)

Related

Merge HTML table rows in SQL server

I am generating the following string in SQL Server which consists of pay data of employees, no.of rows keep varying according to the pay components each employee gets. Even pay types are not fixed for any two given employees. Almost all the pay components vary according to the employees experience, position, qualification, etc.,
<table style="color: #000066; border-collapse: collapse; font-family: Arial,sans-serif; width: 100%; font-size: 10.0pt;" border="1" cellpadding="5">
<tbody>
<tr style="text-align: center;">
<th>Pay Type</th>
<th>Pay Desc</th>
<th>Pay Freq</th>
<th>Currency</th>
<th>Amount</th>
<th>Per Annum</th>
</tr>
<tr>
<td>Salary</td>
<td>Basic Salary</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">23750.00</td>
<td style="text-align: center;">285000.00</td>
</tr>
<tr>
<td>Salary</td>
<td>House Rent Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">11875.00</td>
<td style="text-align: center;">142500.00</td>
</tr>
<tr>
<td>Salary</td>
<td>Conveyance Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">1600.00</td>
<td style="text-align: center;">19200.00</td>
</tr>
<tr>
<td>Salary</td>
<td>Education Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">200.00</td>
<td style="text-align: center;">2400.00</td>
</tr>
<tr>
<td>Salary</td>
<td>Fp Bal</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">34550.00</td>
<td style="text-align: center;">414600.00</td>
</tr>
<tr>
<td>Salary</td>
<td>Ecal</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">144000.00</td>
<td style="text-align: center;">144000.00</td>
</tr>
<tr>
<td>Salary</td>
<td>Retention Pay</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">105000.00</td>
<td style="text-align: center;">105000.00</td>
</tr>
<tr>
<td>Reimbursements</td>
<td>Medical Reimb. Normal</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">25000.00</td>
<td style="text-align: center;">300000.00</td>
</tr>
<tr>
<td>Reimbursements</td>
<td>Phone, Datacard, Landline</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2800.00</td>
<td style="text-align: center;">33600.00</td>
</tr>
<tr>
<td>Reimbursements</td>
<td>Phone</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">1000.00</td>
<td style="text-align: center;">1000.00</td>
</tr>
<tr>
<td>Reimbursements</td>
<td>Datacard</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">833.00</td>
<td style="text-align: center;">833.00</td>
</tr>
<tr>
<td>Reimbursements</td>
<td>Spectacle</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2500.00</td>
<td style="text-align: center;">2500.00</td>
</tr>
<tr>
<td>Benefits</td>
<td>Car Valuation (New Car Scheme)</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">3500.00</td>
<td style="text-align: center;">42000.00</td>
</tr>
<tr>
<td>Benefits</td>
<td>Leave Travel Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2084.00</td>
<td style="text-align: center;">25008.00</td>
</tr>
<tr>
<td>Benefits</td>
<td>Bonus</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">12584.00</td>
<td style="text-align: center;">151008.00</td>
</tr>
<tr>
<td>Benefits</td>
<td>Esop</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">282716.00</td>
<td style="text-align: center;">282716.00</td>
</tr>
<tr>
<td>Retirement Benefits</td>
<td>Employee Pf</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2850.00</td>
<td style="text-align: center;">34200.00</td>
</tr>
<tr>
<td>Retirement Benefits</td>
<td>Employee Gratuity</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">1000.00</td>
<td style="text-align: center;">12000.00</td>
</tr>
</tbody>
</table>
If you observe column one, most of the data is repetative. Is it possible to merge the rows of first column depending on the data it contains in sql server. So that the string looks like below.
<table style="color: #000066; border-collapse: collapse; font-family: Arial,sans-serif; width: 100%; font-size: 10.0pt;" border="1" cellpadding="5">
<tbody>
<tr style="text-align: center;">
<th>Pay Type</th>
<th>Pay Desc</th>
<th>Pay Freq</th>
<th>Currency</th>
<th>Amount</th>
<th>Per Annum</th>
</tr>
<tr>
<td rowspan="7">Salary</td>
<td>Basic Salary</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">23750.00</td>
<td style="text-align: center;">285000.00</td>
</tr>
<tr>
<td>House Rent Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">11875.00</td>
<td style="text-align: center;">142500.00</td>
</tr>
<tr>
<td>Conveyance Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">1600.00</td>
<td style="text-align: center;">19200.00</td>
</tr>
<tr>
<td>Education Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">200.00</td>
<td style="text-align: center;">2400.00</td>
</tr>
<tr>
<td>Fp Bal</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">34550.00</td>
<td style="text-align: center;">414600.00</td>
</tr>
<tr>
<td>Ecal</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">144000.00</td>
<td style="text-align: center;">144000.00</td>
</tr>
<tr>
<td>Retention Pay</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">105000.00</td>
<td style="text-align: center;">105000.00</td>
</tr>
<tr>
<td rowspan="5">Reimbursements</td>
<td>Medical Reimb. Normal</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">25000.00</td>
<td style="text-align: center;">300000.00</td>
</tr>
<tr>
<td>Phone, Datacard, Landline</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2800.00</td>
<td style="text-align: center;">33600.00</td>
</tr>
<tr>
<td>Phone</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">1000.00</td>
<td style="text-align: center;">1000.00</td>
</tr>
<tr>
<td>Datacard</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">833.00</td>
<td style="text-align: center;">833.00</td>
</tr>
<tr>
<td>Spectacle</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2500.00</td>
<td style="text-align: center;">2500.00</td>
</tr>
<tr>
<td rowspan="4">Benefits</td>
<td>Car Valuation (New Car Scheme)</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">3500.00</td>
<td style="text-align: center;">42000.00</td>
</tr>
<tr>
<td>Leave Travel Allowance</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2084.00</td>
<td style="text-align: center;">25008.00</td>
</tr>
<tr>
<td>Bonus</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">12584.00</td>
<td style="text-align: center;">151008.00</td>
</tr>
<tr>
<td>Esop</td>
<td style="text-align: center;">Yearly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">282716.00</td>
<td style="text-align: center;">282716.00</td>
</tr>
<tr>
<td rowspan="2">Retirement Benefits</td>
<td>Employee Pf</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">2850.00</td>
<td style="text-align: center;">34200.00</td>
</tr>
<tr>
<td>Employee Gratuity</td>
<td style="text-align: center;">Monthly</td>
<td style="text-align: center;">INR</td>
<td style="text-align: center;">1000.00</td>
<td style="text-align: center;">12000.00</td>
</tr>
</tbody>
</table>
Following is my query to generate this string.
set #tabSalary=N'<table cellpadding="5" style="color:#000066;border-collapse: collapse;font-family:Arial,sans-serif;width:100%;font-size: 10.0pt;" border="1">'
+ N'<tr style="text-align:center;"><th>Pay Type</th><th>Pay Desc</th><th>Pay Freq</th><th>Currency</th><th>Amount</th>
<th>Per Annum</th>
</tr>'
+ CAST((
SELECT isnull(p.PayTypeDesc,'') AS td,
isnull(dbo.ProperCase(p.PayDesc),'') AS td,
isnull(p.PayFrequency,'') as tda,
isnull(p.Currency,'') as tda,
isnull(cast(p.PerMonth as varchar),'') as tda,
isnull(cast(p.PerAnnum as varchar),'') as tda
FROM #saltmp p
order by p.sort1, p.sort2
FOR XML RAW('tr'), ELEMENTS
) AS NVARCHAR(MAX))
+ N'</table>'
SET #tabSalary = REPLACE(#tabSalary, '<tda>', '<td style="text-align:center;">')
SET #tabSalary = REPLACE(#tabSalary, '</tda>', '</td>')
Below is my solution. Quite complex, though.
A few notes before that:
i would personally not recommend this kind of processings within SQL Server, because it is not optimized for them
this should be done on your front-end, because of maintainability and flexibility of your HTML, CSS, event-handlig, etc...
nevertheless, such queries are a challenge from SQL perspective, so hopefully this may help you aнд others as well
DECLARE
#rowsHtml NVARCHAR(MAX), #htmlASxml XML;
;WITH CTE AS (
SELECT
DENSE_RANK() OVER (ORDER BY p.PayTypeDesc) AS PayTypeDesc_GroupSortingIndex,
ROW_NUMBER() OVER (PARTITION BY p.PayTypeDesc ORDER BY p.sort1, p.sort2) AS PayTypeDesc_GroupInnerSortingIndex,
COUNT(*) OVER (PARTITION BY p.PayTypeDesc) AS PayTypeDesc_Count,
ISNULL(p.PayTypeDesc,'') AS PayTypeDesc,
ISNULL(p.PayDesc,'') AS PayDesc,
ISNULL(p.PayFrequency,'') AS PayFrequency,
ISNULL(p.Currency,'') AS Currency,
ISNULL(CAST(p.PerMonth AS VARCHAR(10)),'') AS PerMonth,
ISNULL(CAST(p.PerAnnum AS VARCHAR(10)),'') AS PerAnnum
FROM #saltmp p
)
SELECT #htmlASxml = (
SELECT
PayTypeDesc_Count AS 'PayTypeDesc/#rowspan',
PayTypeDesc,
PayDesc,
PayFrequency,
Currency,
PerMonth,
PerAnnum
FROM (
SELECT
PayTypeDesc_Count,
PayTypeDesc,
PayDesc,
PayFrequency,
Currency,
PerMonth,
PerAnnum,
PayTypeDesc_GroupSortingIndex,
PayTypeDesc_GroupInnerSortingIndex
FROM CTE
WHERE PayTypeDesc_GroupInnerSortingIndex = 1
UNION ALL
SELECT
null,null,
PayDesc,
PayFrequency,
Currency,
PerMonth,
PerAnnum,
PayTypeDesc_GroupSortingIndex,
PayTypeDesc_GroupInnerSortingIndex
FROM CTE
WHERE PayTypeDesc_GroupInnerSortingIndex != 1
) as D
ORDER BY PayTypeDesc_GroupSortingIndex, PayTypeDesc_GroupInnerSortingIndex
FOR XML PATH('tr')
);
Here is a screenshot of the replacements you should do. (I don't know why but some of my single-quoted strings are not showing up when I post the answer)
Plеase, don't forget to put your vote and accept this answer if appropriate.
Thanks!

CSV and html as one of the column

Have csv create but FileHelpers library (but don;t think its important here. However my csv is comma delimeted file. I always make quotes between each field. In my last column i am pulling html code. However when trying to open csv in excel part of my html field column data is going to first column and some data from html is placed in B column in excel Can someone help here and tell me what's wrong? Here's exact example:
Sample csv
Artikelnummer,Vater,Variation1,Variationswert1,Variation2,Variationswert2,Variation3,Variationswert3,Barcode,Artikelname,Artikelname2,Hersteller,KategorieLevel1,KategorieLevel2,KategorieLevel3,KategorieLevel4,KategorieLevel5,Merkmalname1,Merkmalwertname1,Merkmalname2,Merkmalwertname2,Merkmalname3,Merkmalwertname3,Html
"29.1023.1","","Height","WeiB","","","","","","","","","","Kategoria_A","Podkategoria_A","","co tu?","Height","WeiB","","","","","<meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/>
<b style=""font-size:22pt;"">Überblick:
</b>
<br>
</br>
<table cellpadding=""10"" cellspacing=""10"" align=""left"" style=""font-size:12pt;table-layout:fixed;width:30%;"">
<tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Marke:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">JUSThome
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Serie:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">blabla
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Artikel-Nr.:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">29.1023.1
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Height:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Zur auswahl
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Material:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Material_B1
</td>
</tr>
</table><table cellpadding=""10"" cellspacing=""10"" align=""right"" style=""font-size:12pt;table-layout:fixed;width:70%;"">
<tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Abmessungen:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;""></td>
</tr><tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Höhe:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">1,00 cm
</td>
</tr><tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Breite:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">2,00 cm
</td>
</tr>
</table><div style=""clear:both !important;"">
</div>
<br>
</br>
<b style=""font-size:22pt;"">Abmessungen im Detail:
</b>
<ul>
<li style=""font-size:12pt;"">Höhe: 1,00 cm</li><li style=""font-size:12pt;"">Breite: 2,00 cm</li>
</ul>
<ul>
<li style=""font-size:12pt;"">Kot : kott </li><li style=""font-size:12pt;"">Swinia : swiania </li>
</ul>
<br>
</br>
<b style=""font-size:22pt;"">Sekcja_A:
</b>
<ul>
<li style=""font-size:12pt;"">WK</li><li style=""font-size:12pt;"">ZW</li>
</ul>
<br>
</br>
<b style=""font-size:22pt;"">Sekcja_Design:
</b>
<ul>
<li style=""font-size:12pt;"">NF</li>
</ul>
<br>
</br>
"
"29.1023.2","","Height","WeiB","","","","","","","","","","Kategoria_A","Podkategoria_A","","co tu?","Height","WeiB","","","","","<meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/>
<b style=""font-size:22pt;"">Überblick:
</b>
<br>
</br>
<table cellpadding=""10"" cellspacing=""10"" align=""left"" style=""font-size:12pt;table-layout:fixed;width:30%;"">
<tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Marke:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">JUSThome
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Serie:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">blabla
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Artikel-Nr.:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">29.1023.2
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Height:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">WeiB
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Material:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Material_B1
</td>
</tr>
</table><table cellpadding=""10"" cellspacing=""10"" align=""right"" style=""font-size:12pt;table-layout:fixed;width:70%;"">
<tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Abmessungen:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;""></td>
</tr><tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Höhe:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">1,00 cm
</td>
</tr><tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Breite:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">2,00 cm
</td>
</tr>
</table><div style=""clear:both !important;"">
</div>
<br>
</br>
<b style=""font-size:22pt;"">Abmessungen im Detail:
</b>
<ul>
<li style=""font-size:12pt;"">Höhe: 1,00 cm</li><li style=""font-size:12pt;"">Breite: 2,00 cm</li>
</ul>
<ul>
<li style=""font-size:12pt;"">Kot : kott </li><li style=""font-size:12pt;"">Swinia : swiania </li>
</ul>
<br>
</br>
<b style=""font-size:22pt;"">Sekcja_A:
</b>
<ul>
<li style=""font-size:12pt;"">WK</li><li style=""font-size:12pt;"">ZW</li>
</ul>
<br>
</br>
<b style=""font-size:22pt;"">Sekcja_Design:
</b>
<ul>
<li style=""font-size:12pt;"">NF</li>
</ul>
<br>
</br>
"
"29.1023.3","","Height","WeiB","","","","","","","","","","Kategoria_A","Podkategoria_A","","co tu?","Height","WeiB","","","","","<meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/>
<b style=""font-size:22pt;"">Überblick:
</b>
<br>
</br>
<table cellpadding=""10"" cellspacing=""10"" align=""left"" style=""font-size:12pt;table-layout:fixed;width:30%;"">
<tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Marke:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">JUSThome
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Serie:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">blabla
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Artikel-Nr.:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">29.1023.3
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Height:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">WeiB
</td>
</tr><tr>
<td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Material:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Material_B1
</td>
</tr>
</table><table cellpadding=""10"" cellspacing=""10"" align=""right"" style=""font-size:12pt;table-layout:fixed;width:70%;"">
<tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Abmessungen:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;""></td>
</tr><tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Höhe:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">1,00 cm
</td>
</tr><tr>
<td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Breite:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">2,00 cm
</td>
</tr>
</table><div style=""clear:both !important;"">
</div>
<br>
</br>
<b style=""font-size:22pt;"">Abmessungen im Detail:
</b>
<ul>
<li style=""font-size:12pt;"">Höhe: 1,00 cm</li><li style=""font-size:12pt;"">Breite: 2,00 cm</li>
</ul>
<ul>
<li style=""font-size:12pt;"">Kot : kott </li><li style=""font-size:12pt;"">Swinia : swiania </li>
</ul>
<br>
</br>
<b style=""font-size:22pt;"">Sekcja_A:
</b>
<ul>
<li style=""font-size:12pt;"">WK</li><li style=""font-size:12pt;"">ZW</li>
</ul>
<br>
</br>
<b style=""font-size:22pt;"">Sekcja_Design:
</b>
<ul>
<li style=""font-size:12pt;"">NF</li>
</ul>
<br>
</br>
"
This how it looks like in excel. Every data is placed correctly without html part:
That's how it looks like when i open it in excel without any modification (before text to columns option):
It works fine on Excel 2013. See the screen shot. I just saved the content in .csv file and opened in excel.
Since this is not technically an answer I was going to put this as a comment to your question. However, my "reputation" isn't high enough to comment. Ironic that I can answer questions, but not comment on them. Anyway...I copied and pasted your example on my Macbook and saved it as CSV. It opened in Excel fine for me. I have a feeling it's got something to do with the way newlines are treated by Mac vs. PC. Wish I could be more help, but since it opens fine for me I can't really troubleshoot the problem.
Screenshot
Screenshot

Print all lines from account.invoice.line model

I created a new template for printing, and i want to customize it so it prints all the lines from account.invoice.line model. Is there a way you can do that. Here is the code of the template so far.
<t t-name="account.specifikacioni_report_document">
<t t-call="report.external_layout">
<div class="page">
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th>Quantity</th>
<th class="text-right">Unit Price</th>
<th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line" t-as="l">
<td>
<span t-field="l.name"/>
</td>
<td>
<span t-field="l.quantity"/>
<span t-field="l.uos_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td class="text-right" groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal" t-field-options="{"widget": "monetary", "display_currency": "o.currency_id"}"/>
</td>
</tr>
</tbody>
</table>
</div>
</t>
</t>
This prints invoice lines for one invoice cause I copied the account.report_invoice_document and just edited it, but how can I list all invoice lines here not only the invoice lines for an invoice
You can follow the report_invoice.xml to print the lines.
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th>Quantity</th>
<th class="text-right">Unit Price</th>
<th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line" t-as="l">
<td><span t-field="l.name"/></td>
<td>
<span t-field="l.quantity"/>
<span t-field="l.uos_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td class="text-right" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</tbody>
</table>

selenium not finding correct link using xpath

I'm trying to delete click on link generated by a previous test (a delete link) but I'm having great difficulty with xpath
Here is the error I am receiving
Invalid response while accessing the Selenium Server at 'http://localhost:4444/s
elenium-server/driver/': ERROR: Element xpath=(//td[normalize-space() ='Test tit
le 2']/following-sibling::td[3]/descendant::a[.='delete']) not found
here is my test
public function testdeleteStationTestCase()
{
$this->open("/upd8r_new/");
$this->click("css=a > img");
$this->waitForPageToLoad("30000");
$this->type("name=username", "glass2");
$this->type("name=password", "glass2");
$this->click("name=submit");
sleep(1);
$this->click("xpath=(//td[normalize-space() ='Test title 2']/following-sibling::td[3]/a[.='delete'])");
//$this->click("xpath=(//td[normalize-space() ='Test title 2']/following-sibling::td[3]/descendant::a[.='delete'][1])");
sleep(1);
$this->assertTrue($this->isTextPresent("Station deleted!"),"Station Deleted");
}
as you can see my commented out line i have been trying all sorts of combinations to get the test to run-
here is the html page I am testing against- i have added a line of text where I am trying to click
<body>
<!-- social media header -->
<div class="main">
<div class="header">
Central Control Panel
</div>
<div class="logo">
<img src="http://localhost/upd8r_new/imgs/loyalty_connect2.png"/>
</div>
<div style="clear:both"></div>
<ul class="Menu" id="maintab">
<li class="selected" rel="home">HOME </li>
<li rel="retail">
RETAIL </li>
<li rel="stats"> STATS</li>
<li
rel="social_media_settings"> SETTINGS</li>
<li rel="logout">LOGOUT </li>
</ul>
<div style="clear:both"></div>
<div style="text-align:left;width:980px;height:40px;background-color:#0E477A;margin:auto;padding-top:0px;">
<div style="width:700px;text-align:left;padding-left:10px;float:left">
<div id="logout" class="submenustyle">
</div>
<div id="retail" class="submenustyle">
<ul class="sub_menu">
<li>USERS</li>
<li>COMPETITIONS</li>
</ul>
</div>
<div id="home" class="submenustyle">
<ul class="sub_menu">
<li>ADD LIKESTATION</li>
<li>ADD PICSTATION</li>
<li>ADD VIDSTATION</li>
</ul>
</div>
<div id="socialmedia_users" class="submenustyle">
</div>
<div id="stats" class="submenustyle">
<ul class="sub_menu">
<li>STATS HOME</li>
<li>FACEBOOK STATS</li>
</ul>
</div>
<div id="social_media_settings" class="submenustyle">
<ul class="sub_menu">
<li>SETTINGS HOME</li>
<li>NETWORKS TO USE</li>
<li>PRE REGISTRATION</li>
<li>
APP SETTINGS
</li>
</ul>
</div>
</div>
<div style="float:right;font-weight:bold;color:#fff;margin-top:12px;margin-right: 20px;">
Logged In As: glass2 </div>
</div>
<div style="clear:both"></div>
<div style="padding-top:30px;padding-left:10px">Station deleted! </div>
<div style="padding-left:10px">
<table width="700px" align="left" style="text-align:left;">
<tr>
<td style="font-weight:bold">Pre-Registration</td>
<td>http://localhost/upd8r_new/retail/register/80</td>
</tr>
</table>
<div style="clear:both"></div>
<table width="800px" align="left" style="text-align:left;">
<tr style="font-weight:bold;background-color:#f1f1f1">
<td colspan="6" STYLE="text-align:center;font-weight:bold">LIKESTATIONS</td>
</tr>
<tr style="font-weight:bold;background-color:#f1f1f1">
<td width="10%">STATION ID</td>
<td width="32%">STATION NAME</td>
<td width="25%">LINK TITLE</td>
<td width="10%">STATION STATS</td>
<td width="15%">LAST POST</td>
<td width="8%"></td>
</tr>
<tr>
<td>gla20311344 </td>
<td>http://localhost/upd8r_new/socialmedia/edit/gla20311344 </td>
<td>Webcast </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2084629867 </td>
<td>http://localhost/upd8r_new/socialmedia/edit/gla2084629867 </td>
<td>tes this link title3 </td>
<td>STATS </td>
<td>4 weeks ago</td>
<td>delete</td>
</tr>
</table>
<div style="clear:both"></div>
<table width="620px" align="left" style="text-align:left;">
<tr style="font-weight:bold;background-color:#f1f1f1">
<td colspan="5" STYLE="text-align:center;font-weight:bold">FACEBOOK PIC STATIONS</td>
</tr>
<tr style="font-weight:bold;background-color:#f1f1f1">
<td width="15%">STATION ID</td>
<td width="50%">STATION TITLE</td>
<td width="10%">STATION STATS</td>
<td width="15%">LAST POST</td>
<td width="10%"></td>
</tr>
<tr>
<td>gla1079978359 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>**link I'm trying to click**delete</td>
</tr>
<tr>
<td>gla1229158969 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1256364596 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1529784490 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla159062284 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla175038477 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1777127061 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla180142977 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1950664292 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1971709701 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2028774169 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2035285297 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2072665757 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2115042517 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2141659529 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla4705592 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla565900575 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla608150382 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla979271929 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
</table>
<div style="clear:both"></div>
<table width="520px" align="left" style="text-align:left;">
<tr style="font-weight:bold;background-color:#f1f1f1">
<td colspan="4" STYLE="text-align:center;font-weight:bold">FACEBOOK VIDEO STATIONS</td>
</tr>
<tr style="font-weight:bold;background-color:#f1f1f1">
<td width="20%">STATION ID</td>
<td width="60%">STATION TITLE</td>
<td width="60%">STATION STATS</td>
<td width="20%"></td>
</tr>
</table>
<div style="clear:both"></div>
</div>
</div>
<div class="footer">
<div style="float:left;padding-top:20px;padding-left:20px;font-size:10px;font-family:arial"></div>
<div style="padding-top:20px;float:right;padding-right:30px;"><img src="http://localhost/upd8r_new/imgs/excelerated.jpg"/></div>
</div>
</body>
</html>
Your problem is in sleep(1);
In this place instead of sleep(1); you should use this:
$this->waitForCondition("selenium.isElementPresent(\'css=table:contains(\'FACEBOOK PIC STATIONS\') a:contains(\'delete\')\')", "20000");
And by the way, while you use selenium RC you can reach your delete link with this css (with webdriver it will not work as :contains is not a part of css spec):
$this->click("css=table:contains('FACEBOOK PIC STATIONS') a:contains('delete')");
Also replace all sleep(1); with appropriate waitForCondition commands
Install "XPath Checker 4.4" add-ons in Firefox. So for that object you will get proper xpath using this add-ons..
So,
click xpath=xpath for that object

Selenium RC - Having difficulty with Selenium IDE to find a table cell

I hope someone here can help me. Im using selenium to test a page that has an image which when click displays a calendar. I can get as far as clicking the image using
browser.click("//center/table/tbody/tr/td[1]/a/img")
I got the above path by using the Selenium IDE. The problem is once i click the above image the Selenium IDE does not record what i have clicked after the calendar is shown.
Here is the code for the image button
<INPUT size='8' CLASS="field-date" TYPE="text" NAME="endQtrDate" VALUE="01/10/2004" ID="endQtrDate" onBlur="this.value=validateFieldValue(this.value,'date_error','endQtrDate',this.form)" onFocus="this.select()" TITLE="Enter date in format dd/mm/yyyy" />
<IMG ALIGN="absmiddle" ALT="Press to show calendar picker" NAME="calendarButton" SRC="../images/buttons/small/calendar.gif" onClick="return showCalendar('endQtrDate', 'dd/MM/yyyy');" />
Unfortunately i cant see the code for the calendar after i click it. The only way i can see it is using the mozilla plugin "Firebug". I managed to get the div layer of which the calendar is displayed.
<div class="calendar"
style="position: absolute; display: none; left: 234px; top: 416px;">
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<td colspan="1" class="button">-</td>
<td colspan="6" class="title" style="cursor: move;">October,
2004</td>
<td colspan="1" class="button">×</td>
</tr>
<tr class="headrow">
<td colspan="1" class="button">«</td>
<td colspan="1" class="button">‹</td>
<td colspan="4" class="button">Today</td>
<td colspan="1" class="button">›</td>
<td colspan="1" class="button">»</td>
</tr>
<tr class="daynames">
<td class="name wn">wk</td>
<td class="day name">Mon</td>
<td class="day name">Tue</td>
<td class="day name">Wed</td>
<td class="day name">Thu</td>
<td class="day name">Fri</td>
<td class="name day weekend">Sat</td>
<td class="name day weekend">Sun</td>
</tr>
</thead>
<tbody>
<tr class="daysrow">
<td class="day wn">40</td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day">1</td>
<td class="day weekend">2</td>
<td class="day weekend">3</td>
</tr>
<tr class="daysrow">
<td class="day wn">41</td>
<td class="day">4</td>
<td class="day">5</td>
<td class="day">6</td>
<td class="day">7</td>
<td class="day">8</td>
<td class="day weekend">9</td>
<td class="day weekend">10</td>
</tr>
<tr class="daysrow">
<td class="day wn">42</td>
<td class="day">11</td>
<td class="day">12</td>
<td class="day">13</td>
<td class="day">14</td>
<td class="selected day">15</td>
<td class="day weekend">16</td>
<td class="day weekend">17</td>
</tr>
<tr class="daysrow">
<td class="day wn">43</td>
<td class="day">18</td>
<td class="day">19</td>
<td class="day">20</td>
<td class="day">21</td>
<td class="day">22</td>
<td class="day weekend">23</td>
<td class="day weekend">24</td>
</tr>
<tr class="daysrow">
<td class="day wn">44</td>
<td class="day">25</td>
<td class="day">26</td>
<td class="day">27</td>
<td class="day">28</td>
<td class="day">29</td>
<td class="day weekend">30</td>
<td class="day weekend">31</td>
</tr>
<tr class="emptyrow">
<td class="day wn">36</td>
<td class="day">30</td>
<td class="day">31</td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
</tr>
</tbody>
<tfoot>
<tr class="footrow">
<td colspan="8" class="ttip" style="cursor: move;">Select date</td>
</tr>
</tfoot>
</table>
<div class="combo" style="display: none;">
<div class="label">Jan</div>
<div class="label">Feb</div>
<div class="label">Mar</div>
<div class="label">Apr</div>
<div class="label">May</div>
<div class="label">Jun</div>
<div class="label">Jul</div>
<div class="label">Aug</div>
<div class="label">Sep</div>
<div class="label">Oct</div>
<div class="label">Nov</div>
<div class="label">Dec</div>
</div>
<div class="combo" style="display: none;">
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
</div>
</div>
If you look carefully you will see table cells for dates from 1 to 30th. How can i access these values using Selenium? I can use the IDE as it doesnt record anything when the calendar pops up.
The firebug has an option to display the xpath of any tag. I tried it on one of the td tags and it says this is the xpath.
/html/body/div/table/thead/tr[2]/td[3]
Can i use the above path to determine its value then click on it using selenium?
Thanks
To click on the image you can use click | calendarButton and that should load it up for you.
From there you will then need to click on items I would then use firebug to see the other items on the page.
Edit from extra info:
What you need to do then is use xpath=//td[#class="day" and text()="14"] for xpath or for css use css=td.day:contains('14')
The css route will be a lot quicker in browsers like Internet Explorer