So moving into the digital age my wife made a Lunch schedule in a google sheet and shared that with the family. But I want to add it into my hass install to!
The Google Sheet is published online and I can access it but I’m having a hard time scraping it. Teh HTML looks like this:
<table class="waffle" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th class="row-header freezebar-origin-ltr header-shim row-header-shim"></th>
<th id="67C0" style="width:243px" class="header-shim"></th>
<th id="67C1" style="width:440px" class="header-shim"></th>
</tr>
</thead>
<tbody>
<tr style="height:54px;">
<th id="67R0" style="height: 54px;" class="row-headers-background row-header-shim"><div class="row-header-wrapper" style="line-height: 54px;">1</div></th>
<td class="s0" dir="ltr" colspan="2">Vecka 8</td>
</tr>
<tr style="height:40px;"><th id="67R1" style="height: 40px;" class="row-headers-background row-header-shim"><div class="row-header-wrapper" style="line-height: 40px;">2</div></th>
<td class="s1" dir="ltr">Dag</td>
<td class="s1" dir="ltr">Mat</td>
</tr>
<tr style="height:40px;">
<th id="67R2" style="height: 40px;" class="row-headers-background row-header-shim"><div class="row-header-wrapper" style="line-height: 40px;">3</div></th>
<td class="s2" dir="ltr">Måndag</td>
<td class="s3" dir="ltr">Limekyckling och broccoli + ris</td>
</tr>
<tr style="height:40px;">
<th id="67R3" style="height: 40px;" class="row-headers-background row-header-shim"><div class="row-header-wrapper" style="line-height: 40px;">4</div></th>
<td class="s4" dir="ltr">Tisdag</td>
<td class="s5" dir="ltr">Köttbullar och mos/broccoli + gräddsås</td>
</tr>
etc etc etc.
I’ve tried using select: ".waffle .s3"
works and it picks out the first row with the s3 class. the problem is that the same class is in more place further down so that won’t work.
Using select: "tr#67R2 > .s3"
just throws me an error in the log file, I even tried select: 'td:nth-of-type(4)'
but that to gave me errors for some reason
[edit, things I’ve tried so far]
select: "tr#67R2 > .s3"
= soupsieve.util.SelectorSyntaxError: Malformed id selector at position 2
line 1:
select: "td:nth-of-type(5)"
= no values
select: ".waffle td:nth-of-type(5)"
= no values
select: "#67R7~ .s7"
= Malformed id selector at position 0, so I can’t start with a #
select: ".waffle s3:nth-of-type(3)"
= no values (Tried to get the 3d time s3 was mentioned)
Running out of ideas now… anyone with a suggestion?