1. Starbuzz Café¶

1.1. Current Starbuzz code¶
7
from urllib.request import urlopen
prices = "https://api.allorigins.win/raw?url=http://beans.itcarlow.ie/prices.html"
page = urlopen(prices)
text = page.read()
print(text)
Activity: 1.1.1 ActiveCode (ac_l33_1_en)
1.2. The CEO only wants the price¶

This is the “raw” HTML text, which is the format of web pages.
The price is embedded in HTML.
<html><head><title>Welcome to the Beans'R'Us Pricing Page</title>
<link rel="stylesheet" type="text/css" href="beansrus.css" />
</head><body>
<h2>Welcome to the Beans'R'Us Pricing Page</h2>
<p>Current price of coffee beans = <strong>$6.73</strong></p>
<p>Price valid for 15 minutes from Sun Jul 11 03:08:01 2021.</p>
</body></html>
We receive the above output as a string of characters.

You have attempted 1 of 2 activities on this page