This says input is an object of ET but isn't input a function? Besides, I never made an object named input so why is this happening?
What should I do to resolve this?
Code:
import xml.etree.ElementTree as ET
import urllib.request,urllib.parse,urllib.error
u=input('Enter Location:')
print("Retirieving ",u)
uh = urllib.request.urlopen(u)
data = uh.read()
print("Retrieved",len(data),"characters")
tree=ET.fromstring(data)
sum=0
c=0
counts = tree.findall('.//count')
for val in counts:
sum+=int(val.text)
c+=1
print("Count:",c)
print("Sum:",sum)
Error message:
TypeError Traceback (most recent call last)
<ipython-input-19-af23c96a0ad5> in <module>
2 import urllib.request,urllib.parse,urllib.error
3
----> 4 u=input('Enter Location:')
5 print("Retirieving ",u)
6
TypeError: 'xml.etree.ElementTree.Element' object is not callable