摘要:
生成器 一个带有 yield 的函数就是一个 generator,它和普通函数不同,生成一个 generator 看起来像函数调用,但不会执行任何函数代码,直到对其调用 next()(在 for 循环中会自动调用 next())才开始执行。虽然执行流程仍按函数的流程执行,但每执行到一个 yield 阅读全文
posted @ 2018-09-21 11:27
agang_19
阅读(551)
评论(0)
推荐(0)
摘要:
import requests res=requests.get('http://www.baidu.com') res.encoding='utf-8' print(res.text) from bs4 import BeatifulSoup html = """ ... head titlehistory""" soup=BeautifulSoup(html) print(so... 阅读全文
posted @ 2018-09-21 11:15
agang_19
阅读(82)
评论(0)
推荐(0)
浙公网安备 33010602011771号