# Scrapy settings for doubanmovie project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
BOT_NAME = "doubanmovie"
SPIDER_MODULES = ["doubanmovie.spiders"]
NEWSPIDER_MODULE = "doubanmovie.spiders"
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = "doubanmovie (+http://www.yourdomain.com)"
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50'
# Obey robots.txt rules
ROBOTSTXT_OBEY = True
# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32
# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16
# Disable cookies (enabled by default)
#COOKIES_ENABLED = False
# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False
# Override the default request headers:
#DEFAULT_REQUEST_HEADERS = {
# "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
# "Accept-Language": "en",
#}
# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
# "doubanmovie.middlewares.DoubanmovieSpiderMiddleware": 543,
#}
# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
# "doubanmovie.middlewares.DoubanmovieDownloaderMiddleware": 543,
#}
# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
# "scrapy.extensions.telnet.TelnetConsole": None,
#}
# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
# "doubanmovie.pipelines.DoubanmoviePipeline": 300,
#}
# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False
# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = "httpcache"
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = "scrapy.extensions.httpcache.FilesystemCacheStorage"
# Set settings whose default value is deprecated to a future-proof value
REQUEST_FINGERPRINTER_IMPLEMENTATION = "2.7"
TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor"
FEED_EXPORT_ENCODING = "utf-8"
#MySQL连接
MYSQL_HOST = 'localhost' # 数据库地址
MYSQL_DBNAME = 'doubanmovie' # 数据库名字
MYSQL_USER = 'root' # 数据库登录名
MYSQL_PASSWD = 'root' # 数据库登录密码
# 数据传输
ITEM_PIPELINES = {
'doubanmovie.pipelines.DoubanmoviePipeline': 301,
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Python电影爬虫数据统计展示案例,主要以豆瓣电影TOP250 https://movie.douban.com/top250 为例,我们需要抓取每一部电影的名字,电影的描述信息(包括导演、主演、电影类型等等),电影的评分,以及电影中最经典或者说脍炙人口的一句话。并将爬取的数据存储到MYSQL数据库中,其中使用了Python的Scrapy框架来进行操作。 Python电影爬虫数据统计展示案例,主要以豆瓣电影TOP250 https://movie.douban.com/top250 为例,我们需要抓取每一部电影的名字,电影的描述信息(包括导演、主演、电影类型等等),电影的评分,以及电影中最经典或者说脍炙人口的一句话。并将爬取的数据存储到MYSQL数据库中,其中使用了Python的Scrapy框架来进行操作。
资源推荐
资源详情
资源评论
收起资源包目录
Python电影爬虫数据统计展示案例.rar (19个子文件)
doubanmovie
doubanmovie
__init__.py 0B
pipelines.py 1KB
spiders
__init__.py 161B
doubanspider.py 2KB
__pycache__
doubanspider.cpython-38.pyc 2KB
__init__.cpython-38.pyc 193B
items.py 591B
settings.py 4KB
__pycache__
settings.cpython-38.pyc 767B
items.cpython-38.pyc 470B
pipelines.cpython-38.pyc 1KB
__init__.cpython-38.pyc 185B
middlewares.py 4KB
scrapy.cfg 276B
.idea
workspace.xml 7KB
misc.xml 367B
modules.xml 281B
.gitignore 184B
doubanmovie.iml 344B
共 19 条
- 1
资源评论
编程指南针
- 粉丝: 5w+
- 资源: 193
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功