not working. I am using python 3.3.2. please and thank you.

import urllib

u = urllib.request('')
info =
f = open('rt22.xml', 'wb')

Recommended Answers

All 4 Replies

Not working --> Exception thrown. Solve the issue described by the exception traceback !

Look here.

Change your code to this ...

from urllib.request import urlopen

u = urlopen('')
info =

print(type(info))  # just a test --> <class 'bytes'>

f = open('rt22.xml', 'wb')

# convert info to string before printing
print(info.decode())  # test

Notice that info is not a string object.

thank you so much. i am new to this. can you explain lines 6 and 13 please. would I need to input this?

Looks like lines 6 and 13 are just test prints for your information.
Most programmers just comment them out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.