From 46f2254ab4f39c270aadae5aa08d41f194a6e28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 22 Jul 2019 21:59:51 +0200 Subject: [PATCH] Scraping --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0daaf9b..a2e281c 100644 --- a/README.md +++ b/README.md @@ -2292,8 +2292,8 @@ Scraping import requests from bs4 import BeautifulSoup url = 'https://en.wikipedia.org/wiki/Python_(programming_language)' -resp = requests.get(url) -doc = BeautifulSoup(resp.text, 'html.parser') +html = requests.get(url).text +doc = BeautifulSoup(html, 'html.parser') table = doc.find('table', class_='infobox vevent') rows = table.find_all('tr') link = rows[11].find('a')['href'] diff --git a/index.html b/index.html index caea88c..6b373e9 100644 --- a/index.html +++ b/index.html @@ -1973,8 +1973,8 @@ logger.<level>('A logging message.') import requests from bs4 import BeautifulSoup url = 'https://en.wikipedia.org/wiki/Python_(programming_language)' -resp = requests.get(url) -doc = BeautifulSoup(resp.text, 'html.parser') +html = requests.get(url).text +doc = BeautifulSoup(html, 'html.parser') table = doc.find('table', class_='infobox vevent') rows = table.find_all('tr') link = rows[11].find('a')['href']