爬虫 抓取猫眼电影排行榜电影名字、作者、上映时间
import requests
import re
def page():
response=requests.get("https://maoyan.com/board/4")
return response.text
def parse(html):
patter=re.compile('<dd>.*?title="(.*?)".*?class="star"(.*?)</p>.*?class="releasetime">(.*?)</p>',re.S)
item=patter.findall(html)
for iin item:
print(i)
if __name__ =='__main__':
print(page())
html=page()
parse(html)