<a class="answer-item_3Zrp6 cos-text-body-lg cos-color-bg" href="https://m.baidu.com/sf?atn=index&lid=0&pd=topone_multi&top=%7B%22sfhs%22%3A1%7D&type=cpage&word=%E8%B1%86%E7%93%A3%E7%94%B5%E5%BD%B1top250&key=1vUSGoNEfpXbocuXspBBhAKuHwGA2DCB1mCYC2A1imd6hOnX48712oj4kVOZBZ2UTw3yepQWl+nXHUfp7cY1U54v12uXmEhuaNFIGkm29R7nSxGfbKn4nyTLY4UYfZe1" target="_blank" data-module="sc_lk" id="answer1"><div class="title-wrapper_oRgzO"><div class="title-wrap_1JCzr"><div class="title_1yN_u"><span class="number-icon_1JilF c-font-baidu-number">01</span><span class="title-text_20WqT cu-line-clamp-1">肖申克的救赎</span></div></div><div class="source_9K0Gy"><span class="source-tag_33SkD">7%结果提及</span></div></div><div><div class="wd-mt-15_rQUxA"><div data-module="answer-text" class="cos-text-body-lg"><div><div class="paragraph-wrapper_2QU3B"><div class="text-wrapper_3SEe3 "><div><div class="_no-spacing_4sbbx_4" data-module="sc_p"><p class="_paragraph_4sbbx_1 cu-font-normal cu-color-text cu-line-clamp-4 md"><span class=" md"></span><span><!--s-slot--><!--s-text-->豆瓣电影top250中,肖申克的救赎以9.7的评分稳居榜首。该电影由弗兰克·德拉邦特执导,蒂姆·罗宾斯和摩根·弗里曼主演,讲述了一个关于友情和希望的故事。
第一部分:思路
通过requests+xpath实现豆瓣电影top250一些信息的爬取
第二部分:分析过程
1.浏览器输入
2.打开主页面,显示有20条电影信息数据
page_url=https://m.baidu.com/sf?pd=topone_multi&top=%7B%22sfhs%22%3A1%7D&atn=index&word=%E8%B1%86%E7%93%A3%E7%94%B5%E5%BD%B1top250&lid=
16638235655785603014&key=bd%2FbPtJ7umUkuPF3fz0H4wbbfR%2FIB8veb6rRjTDeeqEVS%2F1TIXYtLVMW25bRVfFa%2BdvPb0y98zHLTQOcnk8wmJEQqtz76fON2BcDkEuHIdg%
3D&type=bpage
...........................................................................................................................................................................................................
3.通过Ctrl+F搜索电影名字,如肖申克的救赎,找到电影信息的共同规律
已
标签:电影,E7%,爬取,豆瓣,top250,救赎 From: https://www.cnblogs.com/xiaogan-520/p/17853043.html