ICML2020 文章目录及下载链接

2020 年会议线上召开,会议网站也和以往大不相同

官网本身就提供了文章的主题分类检索与下载

在这里插入图片描述

尽管如此,还是希望能够制作一份方便本地查找的目录,毕竟访问外网有点卡

下载 json 文件

通过网站页面源码分析,发现所有数据都在这份 icml_paper.json 文件中,把它下载下来:
https://icml.cc/static/virtual/data/icml_papers.json
在这里插入图片描述
你要是直接打开的话,就是这个样子,当然我们接下来就用 python 的 json 包来解析它!
在这里插入图片描述

解析 json 文件

import json
filename = 'icml_papers.json'
with open(filename, 'r') as file:
    content = file.read()
    js = json.loads(content)
print(len(js))   # 1086 篇文章

获取下载链接

json 文件中没有下载链接,需要跳转到单篇文章页面去下载

def get_download_link(id):
    url = 'https://icml.cc/virtual/2020/poster/'+str(id)  # 通过 id 跳转到单篇文章页面
    html = getPage(url)
    bsObj = BeautifulSoup(html, "lxml")
    return bsObj.find('a', {'href': re.compile('.*static\/paper_files\/icml\/2020\/.*.pdf')})['href']  # 在单篇文章页面获取下载链接

创建 tsv 文件

for j in js:
    with open('result.tsv','a', encoding='utf8') as file:
        item = []
        item.append(str(j['id']))
        item.append(j['content']['title'])
        item.append(', '.join(j['content']['authors']))
        item.append(', '.join(j['content']['keywords']))
        item.append(get_download_link(j['id']))
        s = '\t'.join(item) + '\n'
        print(s)
        file.write(s)

用 excel 打开生成的 tsv 文件,如下所示:
在这里插入图片描述
这里有 1086 篇文章的下载地址哦:https://download.csdn.net/download/itnerd/12789245

既然能用 excel 打开,那就可以做一些统计啦

33 大研究领域

在这里插入图片描述

各类主题占比

最多的是学习理论
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/itnerd/article/details/108328053