Skip to content
Permalink
Browse files

Screenshotting largest diffs

  • Loading branch information...
ianmilligan1 committed May 7, 2019
1 parent 3f42756 commit 5cdb174584cd1993d6970a492ba43b22f834129d
@@ -128,7 +128,18 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 67,
"metadata": {},
"outputs": [],
"source": [
"# let's see the pages with the largest diffs\n",
"\n",
"sorted = ndp_diffs.sort_values('diff',ascending=False)"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {},
"outputs": [
{
@@ -720,15 +731,85 @@
"[89 rows x 5 columns]"
]
},
"execution_count": 49,
"execution_count": 68,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# let's see the pages with the largest diffs\n",
"sorted"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Screenshot the Fifteen Biggest Diffs?"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {},
"outputs": [],
"source": [
"biggest_diffs = []\n",
"for x in range(0,14):\n",
" biggest_diffs.append(\"https://wayback.archive-it.org/227/\" + sorted.iloc[x].tolist()[2][1:] + \"/\" + sorted.iloc[x].tolist()[3])"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['https://wayback.archive-it.org/227/20141105/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20150206/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20140505/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20121103/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20080930/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20100803/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20150805/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20090802/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20091102/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20170205/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20130203/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20140205/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20101103/http://www.ndp.ca/',\n",
" 'https://wayback.archive-it.org/227/20081103/http://www.ndp.ca/']"
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"biggest_diffs"
]
},
{
"cell_type": "code",
"execution_count": 104,
"metadata": {},
"outputs": [],
"source": [
"from selenium import webdriver\n",
"\n",
"DRIVER = 'chromedriver'\n",
"driver = webdriver.Chrome(DRIVER)\n",
"\n",
"ndp_diffs.sort_values('diff',ascending=False)"
"count=1\n",
"for page in biggest_diffs:\n",
" driver.get(page)\n",
" export_file=str(count)+\"-ndp.png\"\n",
" count=count+1\n",
" screenshot = driver.save_screenshot(export_file)\n",
" \n",
"driver.quit()"
]
},
{
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 5cdb174

Please sign in to comment.
You can’t perform that action at this time.