all_url = e.xpath('//div[@class=“chanel-detail” movie-item-title]/a/@href)
return ['http://maoyan.com{}].format(url)[for url in all_url]
def parse_info(html):
e = etree.HTML(html)
name = e.xpath(‘h3[@class=“name”]/text’)
type = e.xpath()
actors = e.xpath()
def main():
index_url = ‘http:maoyan.com/films’
html = get_html(index_url)
movie_urls = parse_index(html)
print(movie_urls)
for url in movie_urls:
movie_html = get_html(url)
movie = parse_info(movie_html)