Get your
own Python
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import requests url = 'https://w3.p2hp.com/python/demopage.htm' x = requests.get(url) #return an iterator, one item for each character: print(x.iter_content()) #looping through the iterator: for c in x.iter_content(): print(c)
<<generator object iter_slices at 0x03534DE0>
b'<'
b'!'
b'D'
b'O'
b'C'
b'T'
b'Y'
b'P'
b'E'
b' '
b'h'
b't'
b'm'
b'l'
b'>'
b'\r'
b'\n'
b'<'
b'h'
b't'
b'm'
b'l'
b'>'
b'\r'
b'\n'
b'<'
b'b'
b'o'
b'd'
b'y'
b'>'
b'\r'
b'\n'
b'\r'
b'\n'
b'<'
b'h'
b'1'
b'>'
b'T'
b'h'
b'i'
b's'
b' '
b'i'
b's'
b' '
b'a'
b' '
b'T'
b'e'
b's'
b't'
b' '
b'P'
b'a'
b'g'
b'e'
b'<'
b'/'
b'h'
b'1'
b'>'
b'\r'
b'\n'
b'\r'
b'\n'
b'<'
b'/'
b'b'
b'o'
b'd'
b'y'
b'>'
b'\r'
b'\n'
b'<'
b'/'
b'h'
b't'
b'm'
b'l'
b'>'