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)

复制代码

相关文章:

  • 2021-06-04
  • 2021-11-22
  • 2021-11-22
  • 2021-11-06
猜你喜欢
  • 2021-06-26
  • 2021-05-29
  • 2021-10-19
  • 2021-09-05
  • 2022-03-09
相关资源
相似解决方案