import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
import ssl

# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

url = input('Enter - ')
if len(url) < 1:
    url = 'http://py4e-data.dr-chuck.net/comments_42.xml'
xml = urllib.request.urlopen(url, context=ctx).read()
tree = ET.fromstring(xml)
lst = tree.findall('.//comment')
counter = 0
for item in lst:
    counter = counter + int(item.find('count').text)
print(counter)

6a7011cd3857a764bd871e85bba8dc2a3655b47e
<mask token>

<mask token>
if len(url) < 1:
    url = 'http://py4e-data.dr-chuck.net/comments_42.xml'
<mask token>
for item in lst:
    counter = counter + int(item.find('count').text)
print(counter)

<mask token>
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = input('Enter - ')
if len(url) < 1:
    url = 'http://py4e-data.dr-chuck.net/comments_42.xml'
xml = urllib.request.urlopen(url, context=ctx).read()
tree = ET.fromstring(xml)
lst = tree.findall('.//comment')
counter = 0
for item in lst:
    counter = counter + int(item.find('count').text)
print(counter)

import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
import ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = input('Enter - ')
if len(url) < 1:
    url = 'http://py4e-data.dr-chuck.net/comments_42.xml'
xml = urllib.request.urlopen(url, context=ctx).read()
tree = ET.fromstring(xml)
lst = tree.findall('.//comment')
counter = 0
for item in lst:
    counter = counter + int(item.find('count').text)
print(counter)

import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
import ssl

# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

url = input('Enter - ')
if len(url) < 1:
    url = 'http://py4e-data.dr-chuck.net/comments_42.xml'
xml = urllib.request.urlopen(url, context=ctx).read()
tree = ET.fromstring(xml)
lst = tree.findall('.//comment')
counter = 0
for item in lst:
    counter = counter + int(item.find('count').text)
print(counter)
