Skip to content
Snippets Groups Projects

Save Page sample

Merged aponb requested to merge aponb/webarchive-api:savepage_sample into master
2 files
+ 68
3
Compare changes
  • Side-by-side
  • Inline
Files
2
sample8.ipynb 0 → 100644
+ 50
0
%% Cell type:markdown id: tags:
%% Cell type:code id: tags:
``` python
import requests
import json
```
%% Cell type:markdown id: tags:
Create a WebarchivSession Object with convenience methods for easy access with your API-Key
%% Cell type:code id: tags:
``` python
from webarchiv import WebarchivSession
apikey = '2pm8i0hnmpcTK4Oj4CUeBoZd7vywrm4c'
w = WebarchivSession(apikey)
```
%% Cell type:raw id: tags:
request archiving a Webpage
%% Cell type:code id: tags:
``` python
response = w.savePage("http://www.onb.ac.at")
if response.status_code == 201:
print(response.json())
else:
print("Error ", response.status_code)
```
%% Output
{'nomination_id': 247, 'seed': 'http://www.onb.ac.at', 'nominationtype': 5}
%% Cell type:code id: tags:
``` python
```
Loading