It may be due to the function in parentheses wrong, or where writing is not standardized
Error codes are as follows:
title=li.xpath[".//a/@href"]
At this point it will error: TypeError: 'method' object is not subscriptable
Modified:
title=li.xpath(".//a/@href")
correct.