From d1306f462e49c76ce5a32451918d9a052ea4ab0b Mon Sep 17 00:00:00 2001 From: Valery Mamontov Date: Mon, 12 Oct 2020 12:29:44 +0300 Subject: [PATCH] Update Chapter01_BeginningToScrape.ipynb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for what to write "as e" in string № 95 and № 100? - "except AttributeError as e:" - "except AttributeError as e:" P.S. what a function by name 'getSiteHTML" in page № 31 (in book "Web Scraping with Python")? --- Chapter01_BeginningToScrape.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chapter01_BeginningToScrape.ipynb b/Chapter01_BeginningToScrape.ipynb index 8d7a74b..dfe652e 100644 --- a/Chapter01_BeginningToScrape.ipynb +++ b/Chapter01_BeginningToScrape.ipynb @@ -92,12 +92,12 @@ "def getTitle(url):\n", " try:\n", " html = urlopen(url)\n", - " except HTTPError as e:\n", + " except AttributeError:\n", " return None\n", " try:\n", " bsObj = BeautifulSoup(html.read(), \"lxml\")\n", " title = bsObj.body.h1\n", - " except AttributeError as e:\n", + " except AttributeError:\n", " return None\n", " return title\n", "\n",