标签:tle 代码 ext parse amp parser map 复制 from
import grequests
from bs4 import BeautifulSoup
def get_title(rep):
soup = BeautifulSoup(rep.text, 'html.parser')
lis = soup.find('ol', class_='grid_view').find_all('li')
for li in lis:
title = li.find('span', class_="title").text
print(title)
reps = (grequests.get('https://movie.douban.com/top250?start={}&filter='.format(i*25)) for i in range(10))
for rep in grequests.map(reps):
get_title(rep)
复制代码
标签:tle 代码 ext parse amp parser map 复制 from
原文地址:https://www.cnblogs.com/qianxunman/p/12179123.html