+ 2
Why doesn't the text content change inside table cells? [Solved]
2 ответов
+ 3
1. When you do the document.select, the view is not yet part of the DOM, because you only add it in the last line.
2. select retrieves only the direct child nodes, so document would only have a single child: html
It is much easier to reference DOM elements by ID because the document object keeps track of all IDs as a dictionary.
So this modification of your code would work, at least it changes all day names to 'hi'
daysrow = html.TR(id='days')
daysrow <= [html.TD(x) for x in schedule]
view <= daysrow
document <= view
weekdays=document['days'].select('td')
for day in weekdays:
day.text = "hi"
+ 2
Tibor Santa thank you very much