I am new to python. I\'m confused by the .
I got a str by using:
response = urllib.request.urlopen(req).read().decode()
There is no difference. Python changed the text representation of type objects between python 2 (Types are written like this:
python 2
>>> type(type('a'))
python 3
>>> type(type('a'))
And that's the reason for the change... the string representation makes it clear that the type is a class.
As for the rest of your problem,
for ID in response:
response is a string and enumerating it gives the characters in the string. Depending on the type of response you may want to use and HTML, JSON or other parser to turn it into python objects.