简易小说爬虫(带有GUI界面) 效果: ‘, ”).replace(‘‘, ”) html = etree.HTML(string) title = html.xpath(‘//div[@class=”bookname”]/h1/text()’) content = html.xpath(‘//div[@id=”content”]/text()’) return [title[0], content[0]] def Del_line(file_path): “””删除文件空行””” with open(file_path, “r”, encodi