hexo搭建个人博客(二)

1. 寻找合适的主题

  • hexo主题官网地址:https://hexo.io/themes/
  • 有的主题是添加了个人域名,可以在网页底端查看主题

2. 安装主题并渲染插件

阅读更多

Scrapy 问题集锦

1. 爬虫出现Forbidden by robots.txt

修改settings.py文件

阅读更多

爬取百度图片

1. 编辑Items.py

1
2
3
4
# 百度图片
class baiduImage(scrapy.Item):
imageName = scrapy.Field()
imageUrl = scrapy.Field()

阅读更多

Scrapy 进阶

1. CrawlSpider

1
class scrapy.spiders.Rule(link_extractor, callback=None, cb_kwargs=None, follow=None, process_links=None, process_request=None)
  • link_extractor是一个链接提取器对象,它定义了如何从每个已爬网页中提取链接。

阅读更多

Scrapy Shell

使用下面的命令使用scrapy shell 并提取网页内容

1
scrapy shell 'http://quotes.toscrape.com/page/1/'

一、 css选择器(返回的是一个数组)

阅读更多

Scrapy 入门

1. 第一个爬虫

以下是官方文档的第一个爬虫例子。可以看到和我们手动使用request库和BeautifulSoup解析网页内容不同,Scrapy专门抽象了一个爬虫父类,我们只需要重写其中的方法,就可以迅速得到一个可以不断爬行的爬虫。

阅读更多

Scrapy 安装及创建

1. 下载Anaconda脚本

1
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.0.1-Linux-x86_64.sh

2. 执行脚本

阅读更多

hexo搭建个人博客(一)

1. 环境说明

阅读更多

JavaScript基础

1. JavaScript基础知识

  • 使用弹出框输出内容

    1
    alert("hello,world!");
  • 显示在控制台

阅读更多

Nginx安装配置及使用

安装配置

1. 下载Nginx

1
wget http://nginx.org/download/nginx-1.8.1.tar.gz

2. 解压并进入目录操作

阅读更多