<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getSize(string):
 """ This functions opens a web sites and then calculate the total size of the page in bytes. This is for the sake of the example. Do not use this technique in real code as it is not a very bright way to do this."""

    try:
        # We open the web page
        with urllib.request.urlopen(string, None, 1) as f:
            return sum(len(line) for line in f)
    except (urllib.error.URLError, socket.timeout) as e:
        return 0