免责声明:本文仅做分享...
未优化,dp简单实现
from DrissionPage import ChromiumPage
import time
url='https://www.maoyan.com/films?showType=2&offset=60'
page=ChromiumPage()
page.get(url)
time.sleep(2)
for i in range(1,20):
# 爬取的页数
for iu_list in page.eles('.movie-item film-channel'):
# 随便写了一个
dit={
'影片名称':iu_list.text,
'海报封面':'',
'影片类型':'',
'影片时长':'',
}
time.sleep(3)
page.scroll.to_bottom()
# 下滑底部
page.ele('x://*[@id="app"]/div/div[2]/div[3]/ul/li[8]/a').click()
# 获取下一页数据等待
time.sleep(3)
page.scroll.to_top()
time.sleep(3)
print(dit)