当前位置:网站首页>Douban top250
Douban top250
2022-06-26 05:04:00 【Rain and dew touch the real king】
from lxml import etree
import time
import random
import requests
headers ={'User-Agent':'Mozila/5.0(Windows NT 10.0;WOW64) AppleWebKit/537.36(KHTML ,like Gecko )Chrome/83.0.4103.61 Safari/537.36'}
def proprcessing (strs):
s=''
for n in strs:
n=''.join(n.split())
s=s+n
return s
def get_movie_info(url):
response =requests.get(url=url,headers=headers)
html = etree.HTML(response.text)
div_all = html.xpath('//div[@class="info"]')
for div in div_all:
names = div.xpath('./div[@class="hd"]/a//span/text()')
name=proprcessing(names)
infos = div.xpath('./div[@class="bd"]/p/text')
info = proprcessing(infos)
score = div.xpath('./div[@class="bd"]/div/span[2]/text()')
evaluation = div.xp('./div[@class = "bd"]/div/span[4]/text()')
summary = div.xpath('./div[@class="bd"]/p[@class="quote"]/span/text()')
print(' The movie name :', name)
print(' Director and actor :',info)
print(' Movie ratings :',score)
print(' Number of evaluators :',evaluation)
print(' Film summary :',summary)
print('_________________')
if __name__=='__name__':
for i in range(0,250,25):
url='https://movie.douban.com/top250?start={page}&filter='.format(page=i)
get_movie_info(url)
time.sleep(random.randint(1,3))
边栏推荐
- 2. < tag dynamic programming and conventional problems > lt.343 integer partition
- Collections and dictionaries
- Stm8 MCU ADC sampling function is triggered by timer
- date_ Range creation date range freq parameter value table and creation example
- Multipass Chinese document - use packer to package multipass image
- Datetime data type - min() get the earliest date and date_ Range() creates a date range, timestamp() creates a timestamp, and tz() changes the time zone
- Multipass中文文档-使用Multipass服务授权客户端
- 广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能
- UWB超高精度定位系统架构图
- [IDE(ImageBed)]Picgo+Typora+aliyunOSS部署博客图床(2022.6)
猜你喜欢

一个从坟墓里爬出的公司

Multipass Chinese document - remote use of multipass

pycharm 导包错误没有警告

Ai+ remote sensing: releasing the value of each pixel

Statsmodels Library -- linear regression model
![[unity3d] human computer interaction input](/img/4d/47f6d40bb82400fe9c6d624c8892f7.png)
[unity3d] human computer interaction input

86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
![[unity3d] collider assembly](/img/de/29ecf4612c540e2df715f56c31cf1a.png)
[unity3d] collider assembly

Codeforces Round #802 (Div. 2)(A-D)

6.1 - 6.2 公钥密码学简介
随机推荐
Use to_ Numeric to numeric type
The first gift of the project, the flying oar contract!
6.1 - 6.2 公钥密码学简介
Interpretation of yolov5 training results
Multipass Chinese documents - improve mount performance
Solution to back-off restarting failed container
2. < tag dynamic programming and conventional problems > lt.343 integer partition
YOLOV5训练结果的解释
Rsync common error messages (common errors on the window)
微信小程序保存图片的方法
Selection of programming language
Datetime data type - min() get the earliest date and date_ Range() creates a date range, timestamp() creates a timestamp, and tz() changes the time zone
NVM installation and use and NPM package installation failure record
图解OneFlow的学习率调整策略
How MySQL deletes all redundant duplicate data
[latex] error type summary (hold the change)
Problem follow up - PIP source change
[quartz] read configuration from database to realize dynamic timing task
Transport layer TCP protocol and UDP protocol
86.(cesium篇)cesium叠加面接收阴影效果(gltf模型)