错误代码:
zoomE=html.xpath("//div[@id='Zoom']") cover=zoomE.xpath("//img/@src") print(cover)
zoomE是一个列表
正确代码:
zoomE=html.xpath("//div[@id='Zoom']")[0] cover=zoomE.xpath("//img/@src") print(cover)
错误代码:
zoomE=html.xpath("//div[@id='Zoom']") cover=zoomE.xpath("//img/@src") print(cover)
zoomE是一个列表
正确代码:
zoomE=html.xpath("//div[@id='Zoom']")[0] cover=zoomE.xpath("//img/@src") print(cover)