{ "cells": [ { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import requests\n", "from PIL import Image\n", "import os" ] }, { "cell_type": "code", "execution_count": 100, "metadata": {}, "outputs": [], "source": [ "session = requests.Session()\n", "session.headers.update({'User-Agent': 'Mozilla/5.0'})" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv(\"../wikisource-data/yellow.tsv\", sep=\"\\t\")" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Strona:A. Kuprin - Straszna chwila.djvu/8\n", "Strona:Abramowski-braterstwo-solidarnosc-wspoldzialanie.pdf/17\n", "Strona:Abramowski-braterstwo-solidarnosc-wspoldzialanie.pdf/18\n", "Strona:Abramowski-braterstwo-solidarnosc-wspoldzialanie.pdf/19\n" ] } ], "source": [ "for i in df[6:10].iterrows():\n", " print(i[1]['title'])" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "94945" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df)" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [], "source": [ "a = df.head()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Unnamed: 0 | \n", "title | \n", "href | \n", "image_url | \n", "text | \n", "
---|---|---|---|---|---|
94940 | \n", "94940 | \n", "Strona:Stanisław Vincenz - Na wysokiej połonin... | \n", "https://pl.wikisource.org//wiki/Strona:Stanis%... | \n", "//upload.wikimedia.org/wikipedia/commons/thumb... | \n", "Wysoko po drugiej stronie drogi, sterczące z ... | \n", "
94941 | \n", "94941 | \n", "Strona:Stanisław Vincenz - Na wysokiej połonin... | \n", "https://pl.wikisource.org//wiki/Strona:Stanis%... | \n", "//upload.wikimedia.org/wikipedia/commons/thumb... | \n", "tępny także dla ludzi biednych, nieuczonych w ... | \n", "
94942 | \n", "94942 | \n", "Strona:Stanisław Vincenz - Na wysokiej połonin... | \n", "https://pl.wikisource.org//wiki/Strona:Stanis%... | \n", "//upload.wikimedia.org/wikipedia/commons/thumb... | \n", "brego, Baal Szem Tow. Tam mieszkał przez lata ... | \n", "
94943 | \n", "94943 | \n", "Strona:Stanisław Vincenz - Na wysokiej połonin... | \n", "https://pl.wikisource.org//wiki/Strona:Stanis%... | \n", "//upload.wikimedia.org/wikipedia/commons/thumb... | \n", "Z Sokolskiej góry widok rozległy. Jest jakby ... | \n", "
94944 | \n", "94944 | \n", "Strona:Stanisław Vincenz - Na wysokiej połonin... | \n", "https://pl.wikisource.org//wiki/Strona:Stanis%... | \n", "//upload.wikimedia.org/wikipedia/commons/thumb... | \n", "\\r\\n\\r\\nIII. PODRÓŻ BABCI\\r\\n W ciepły pogodny... | \n", "
Our servers are currently under maintenance or experiencing a technical problem.\\n\\nPlease try again in a few minutes.
\\n\\nSee the error message at the bottom of this page for more information.
\\n