3. Cut¶
Print output (drag lower right corner to resize)
|
Activity: CodeLens 3.1 (cl_l33_3_en)
Cuts before the second number.
Does not include the second number!

7
from urllib.request import urlopen
PRICES_URL = "https://api.allorigins.win/raw?url=http://beans.itcarlow.ie/prices.html"
page = urlopen(PRICES_URL)
text = page.read()
print(text[234:238])
Activity: 3.2 ActiveCode (ac_l33_3a_en)
3.1. The CEO is happy!¶

3.2. There are no stupid questions¶
Can I put any website in this code?
Yes. Feel free, but don’t forget about decoding.
For example, the following website displays characters with iso8859 decoding.
What does
urllib.request
do?It allows you to chat with the internet.
Can I access a page directly in the browser?
Yes, run the code below which uses
import antigravity
.
3
import antigravity
# Run this code
Activity: 3.2.1 ActiveCode (ac_l33_3b_en)
You have attempted 1 of 4 activities on this page