获取你的
Python 服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
import requests url = 'https://w3schools.org.cn/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>这是一个测试页面</h1>'
b''
b'</body>'
b'</html>'