for li in lis:
title = li.xpath('.li//div[@class="hd"]/a/span[1]/text()').get()
print(title)
以下是报错 我非常确定那个冒号是英文状态下的
C:\Users\imwb\PycharmProjects\demo2\venv\Scripts\python.exe C:/Users/imwb/PycharmProjects/demo2/main.py File "C:/Users/imwb/PycharmProjects/demo2/main.py", line 22 for li in lis: ^SyntaxError: invalid syntaxProcess finished with exit code 1