Is there a way of creating the tags dynamically with the E-factory of lxml? For instance I get a syntax error for the following code:
E.BODY(
E.TABLE(
for row_num in range(len(ws.rows)):
row = ws.rows[row_num]
# create a tr tag
E.TR(
for cell_num in range(len(row)):
cell = row[cell_num]
I get the following error:
for row_num in range(len(ws.rows)):
^
SyntaxError: invalid syntax