1 Star 0 Fork 13

dsp2138/GNE

forked from Gitee 极速下载/GNE 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
example_list.py 494 Bytes
一键复制 编辑 原始数据 按行查看 历史
kingname 提交于 2020-08-02 17:10 . 增加提取列表页的功能
import pprint
import glob
from gne import ListPageExtractor
html_list = glob.glob('test_list_page/163/1.html', recursive=True)
for html_file in html_list:
with open(html_file, encoding='utf-8') as f:
html = f.read()
list_extractor = ListPageExtractor()
result = list_extractor.extract(html,
feature='//*[@id="index2016_wrap"]/div[1]/div[2]/div[2]/div[3]/div[2]/div[5]/div/ul/li[1]/div/div[1]/div/div[1]/h3/a')
pprint.pprint(result)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/notsina/GNE.git
git@gitee.com:notsina/GNE.git
notsina
GNE
GNE
master

搜索帮助