Page 76 -
P. 76
textual data
The cost is embedded in the HTML
Take a closer look at the results of the program. The current price
of beans is right in the middle of the output:
This is the price you need
This is the HTML code to extract from the page.
from the price web page.
The Starbuzz CEO would find it a lot easier if you could extract
the price of beans and just display that, rather than have to look
for it in the HTML. But how do you do that?
A string is a series of characters
The output of the Starbuzz program is an example of a string.
In other words, it’s a series of characters like this:
Somewhere within the string is the price of coffee beans. To
retrieve just the price, all you need to do is go to the right bit
of the string, retrieve the characters that give the price, and You only need these few characters.
display just those characters. But how?
you are here 4 41