我正在尝试使用库 lxml 解析站点并执行下一个循环:
for row in html.xpath("//tr/*"):
result = row.text
print(result)
并获得输出:
8-800-500-1231
John Smith
8-800-600-1245
Tommy Atkins
8-800-800-8314
Joe Blow
但是我怎样才能得到这样的输出呢?
["8-800-500-1231", "John Smith"], ["8-800-600-1245", "Tommy Atkins"], ["8-800-800-8314", "Joe Blow"]