{ "cells": [ { "cell_type": "code", "execution_count": 5, "id": "seven-miniature", "metadata": {}, "outputs": [], "source": [ "import trafilatura" ] }, { "cell_type": "code", "execution_count": 7, "id": "swedish-murder", "metadata": {}, "outputs": [], "source": [ "downloaded = trafilatura.fetch_url('https://traffickingculture.org/encyclopedia/case-studies/giacomo-medici/')" ] }, { "cell_type": "code", "execution_count": 9, "id": "indie-payroll", "metadata": {}, "outputs": [], "source": [ "medici = trafilatura.extract(downloaded)" ] }, { "cell_type": "code", "execution_count": 13, "id": "cubic-rings", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ERROR:trafilatura.downloads:retries/redirects: https://traffickingculture.org/encyclopedia/theory-and-method/ HTTPSConnectionPool(host='traffickingculture.org', port=443): Max retries exceeded with url: /encyclopedia/theory-and-method/ (Caused by ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)))\n", "ERROR:trafilatura.downloads:retries/redirects: https://traffickingculture.org/people/ HTTPSConnectionPool(host='traffickingculture.org', port=443): Max retries exceeded with url: /people/ (Caused by ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)))\n" ] } ], "source": [ "!trafilatura --crawl \"https://traffickingculture.org/encyclopedia/a\" > trafficking_culture_links.txt" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.12" } }, "nbformat": 4, "nbformat_minor": 5 }