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 line: print(x.iter_lines()) #looping through the iterator: for c in x.iter_content(): print(c)
<<generator object Response.iter_lines at 0x04204DE0>
b'<!DOCTYPE html>'
b'<html>'
b'<body>'
b''
b'<h1>This is a Test Page</h1>'
b''
b'</body>'
b'</html>'