请求wrapper登录nber.org。
requests-nber的Python项目详细描述
请求nber是一个定制的Requests类,可以登录国家经济研究局的网站NBER.org。
安装
$ pip install requests_nber
文档
快速启动
NBER类登录到NBER.org并与主机建立连接。 包含一个session属性,该属性返回 Request Session object 使用mainRequests API的所有方法。
>>>importrequests_nber# Establish NBER connection object.>>>deets={'username':'someuser','password':'XXXX'}>>>conn=requests_nber.NBER(login=deets)# Download the HTML of the paper with document id t1.>>>doc_id='t1'>>>html=conn.html(id=doc_id)# Download the document PDF.>>>pdf=conn.pdf(id=doc_id,file='article.pdf')# Download the bibliographic information.>>>biblio=conn.ref(id=doc_id)>>>biblio['doi']'10.3386/t0001'>>>biblio['author']'Seppo Honkapohja and Takatoshi Ito'