From 500d12bc06d2b32b3ab44a5dd942e5defa6e27c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 15 May 2020 18:32:04 +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 8bb0a48..60e35e6 100644 --- a/README.md +++ b/README.md @@ -2448,7 +2448,7 @@ Scraping #### Scrapes Python's URL, version number and logo from Wikipedia page: ```python # $ pip3 install requests beautifulsoup4 -import requests +import requests, sys from bs4 import BeautifulSoup URL = 'https://en.wikipedia.org/wiki/Python_(programming_language)' try: @@ -2464,7 +2464,7 @@ try: file.write(image) print(link, ver) except requests.exceptions.ConnectionError: - print("You've got problems with connection.") + print("You've got problems with connection.", file=sys.stderr) ``` diff --git a/index.html b/index.html index 85a6b55..20e0a3d 100644 --- a/index.html +++ b/index.html @@ -2114,7 +2114,7 @@ logger.<level>('A logging message.')
  • '<str>' - Max age as a string: '1 week, 3 days', '2 months', …
  • #Scraping

    Scrapes Python's URL, version number and logo from Wikipedia page:

    # $ pip3 install requests beautifulsoup4
    -import requests
    +import requests, sys
     from bs4 import BeautifulSoup
     URL = 'https://en.wikipedia.org/wiki/Python_(programming_language)'
     try:
    @@ -2130,7 +2130,7 @@ URL = 'https://en.wikipedia.org/wiki/Python_(programmi
             file.write(image)
         print(link, ver)
     except requests.exceptions.ConnectionError:
    -    print("You've got problems with connection.")
    +    print("You've got problems with connection.", file=sys.stderr)