上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 32 下一页
摘要: CrawlSpider Scrapy框架中分两类爬虫,Spider类和CrawlSpider类。 它是Spider的派生类,Spider类的设计原则是只爬取start_url列表中的网页, 而CrawlSpider类定义了一些规则(rule)来提供跟进link的方便的机制,从爬取的网页中获取link 阅读全文
posted @ 2020-04-06 01:11 一只小小的寄居蟹 阅读(340) 评论(0) 推荐(0)
摘要: 案例分析: 需求:爬取网易新闻的国内板块下的新闻数据 需求分析:当点击国内超链进入国内对应的页面时,会发现当前页面展示的新闻数据是被动态加载出来的,如果直接通过程序对url进行请求,是获取不到动态加载出的新闻数据的。则就需要我们使用selenium实例化一个浏览器对象,在该对象中进行url的请求,获 阅读全文
posted @ 2020-04-05 00:27 一只小小的寄居蟹 阅读(996) 评论(0) 推荐(0)
摘要: Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPol 解决 通过管理员命令方式运行如下命令即可解决: 命令行提权运行「reg add HKLM\SOFTWARE\Policies\Google\Chr 阅读全文
posted @ 2020-04-05 00:19 一只小小的寄居蟹 阅读(466) 评论(0) 推荐(0)
摘要: 需求:爬取站长素材中的高清图片 一.数据解析(图片的地址) 通过xpath解析出图片src的属性值。只需要将img的src的属性值进行解析,提交到管道, 管道就会对图片的src进行请求发送获取图片 spider文件 class ImgSpider(scrapy.Spider): name = 'im 阅读全文
posted @ 2020-04-02 21:41 一只小小的寄居蟹 阅读(694) 评论(1) 推荐(0)
摘要: scrapy五大核心组件简介 引擎(Scrapy) 用来处理整个系统的数据流处理, 触发事务(框架核心) 调度器(Scheduler) 用来接受引擎发过来的请求, 压入队列中, 并在引擎再次请求的时候返回. 可以想像成一个URL(抓取网页的网址或者说是链接)的优先队列, 由它来决定下一个要抓取的网址 阅读全文
posted @ 2020-04-02 00:23 一只小小的寄居蟹 阅读(3587) 评论(0) 推荐(0)
摘要: 保证爬虫文件的parse方法中有可迭代类型对象(通常为列表or字典)的返回,该返回值可以通过终端指令的形式写入指定格式的文件中进行持久化操作。 scrapy使用流程: 创建工程: scrapy startproject ProName 进入工程目录: cd ProName 创建爬虫文件: scrap 阅读全文
posted @ 2020-03-31 20:29 一只小小的寄居蟹 阅读(495) 评论(0) 推荐(0)
摘要: 关闭nginx service nginx stop 设置一个配置文件 order.conf server { listen 80 default_server; listen 443 default_server; server_name www.xxx.cn; location /static 阅读全文
posted @ 2020-03-26 02:47 一只小小的寄居蟹 阅读(4896) 评论(0) 推荐(0)
摘要: 安装对应的 Release yum -y install epel-release Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Resolving Dependencies - 阅读全文
posted @ 2020-03-25 01:26 一只小小的寄居蟹 阅读(698) 评论(0) 推荐(0)
摘要: 自带centos上运行python manage.py runserver的时候报错 django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17). 给django降级 卸载 阅读全文
posted @ 2020-03-25 01:16 一只小小的寄居蟹 阅读(575) 评论(0) 推荐(0)
摘要: flask打包下载zip文件 @app.route('/download_all') def download_all(): zipf = zipfile.ZipFile('Name.zip','w', zipfile.ZIP_DEFLATED) root_path = app.root_path 阅读全文
posted @ 2020-03-15 22:41 一只小小的寄居蟹 阅读(2888) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 32 下一页