基于python爬虫的智慧人才数据分析系统

废话不多说,先看效果图

更多效果图可私信我获取

源码分享

python 复制代码
import os
import sys

def main():
    """Run administrative tasks."""
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', '智慧人才数据分析系统.settings')
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)

if __name__ == '__main__':
    main()
python 复制代码
import jieba  # 分词
from matplotlib import pylab as plt     # 绘图,数据可视化
from wordcloud import WordCloud         # 词云
from PIL import Image                   # 图片处理
import numpy as np                      # 矩阵运算
from pymysql import *
import json
# wordCloud

# 所有词
def get_img(field,targetImgSrc,resImgSrc):
    con = connect(host='localhost', user='root', password='root', database='boss', port=3306, charset='utf8mb4')
    cursor = con.cursor()
    sql = f"select {field} from jobinfo"
    cursor.execute(sql)
    data = cursor.fetchall()
    text = ''
    for i,item in enumerate(data):
        text += item[0]
    cursor.close()
    con.close()

    # 分词
    cut = jieba.cut(text)
    string = ' '.join(cut)
    print(string)

    # 图片
    img = Image.open(targetImgSrc)  # 打开遮罩图片
    img_arr = np.array(img)  # 将图片转化为列表
    wc = WordCloud(
        background_color='white',
        mask=img_arr,
        font_path='STHUPO.TTF'
    )
    wc.generate_from_text(string)

    # 绘制图片
    fig = plt.figure(1)
    plt.imshow(wc)
    plt.axis('off')  # 不显示坐标轴

    # 显示生成的词语图片
    # plt.show()

    # 输入词语图片到文件
    plt.savefig(resImgSrc, dpi=500)

def get_addressCompanyTags_img(targetImgSrc,resImgSrc,addrress):
    con = connect(host='localhost', user='root', password='root', database='boss', port=3306, charset='utf8mb4')
    cursor = con.cursor()
    sql = f"select companyTags from jobinfo where address = '{addrress}'"
    cursor.execute(sql)
    data = cursor.fetchall()
    text = ''
    for i, item in enumerate(data):
        if item[0] != '无':
            tags = json.loads(item[0])
            print(tags)
            for j in tags:
                text = text + j
    cursor.close()
    con.close()

    # 分词
    cut = jieba.cut(text)
    string = ' '.join(cut)
    print(string)

    # 图片
    img = Image.open(targetImgSrc)  # 打开遮罩图片
    img_arr = np.array(img)  # 将图片转化为列表
    wc = WordCloud(
        background_color='white',
        mask=img_arr,
        font_path='STHUPO.TTF'
    )
    wc.generate_from_text(string)

    # 绘制图片
    fig = plt.figure(1)
    plt.imshow(wc)
    plt.axis('off')  # 不显示坐标轴

    # 显示生成的词语图片
    # plt.show()

    # 输入词语图片到文件
    plt.savefig(resImgSrc, dpi=500)

# get_img('companyTitle',r'.\static\2.jpg',r'.\static\companyTitle.jpg')
# get_img('summary',r'.\static\2.jpg',r'.\static\summary_cloud.jpg')
# get_img('casts',r'.\static\3.jpg',r'.\static\casts_cloud.jpg')
python 复制代码
/* iCheck plugin Minimal skin
----------------------------------- */
.icheckbox_minimal,
.iradio_minimal {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/minimal.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal {
    background-position: 0 0;
}
    .icheckbox_minimal.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal {
    background-position: -100px 0;
}
    .iradio_minimal.hover {
        background-position: -120px 0;
    }
    .iradio_minimal.checked {
        background-position: -140px 0;
    }
    .iradio_minimal.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 3/2),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal,
    .iradio_minimal {
        background-image: url(../image/minimal@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* red */
.icheckbox_minimal-red,
.iradio_minimal-red {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/red.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-red {
    background-position: 0 0;
}
    .icheckbox_minimal-red.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-red.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-red.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-red.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-red {
    background-position: -100px 0;
}
    .iradio_minimal-red.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-red.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-red.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-red.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-red,
    .iradio_minimal-red {
        background-image: url(../image/red@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* green */
.icheckbox_minimal-green,
.iradio_minimal-green {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/green.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-green {
    background-position: 0 0;
}
    .icheckbox_minimal-green.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-green.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-green.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-green.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-green {
    background-position: -100px 0;
}
    .iradio_minimal-green.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-green.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-green.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-green.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-green,
    .iradio_minimal-green {
        background-image: url(../image/green@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* blue */
.icheckbox_minimal-blue,
.iradio_minimal-blue {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/blue.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-blue {
    background-position: 0 0;
}
    .icheckbox_minimal-blue.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-blue.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-blue.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-blue.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-blue {
    background-position: -100px 0;
}
    .iradio_minimal-blue.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-blue.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-blue.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-blue.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 3/2),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-blue,
    .iradio_minimal-blue {
        background-image: url(../image/blue@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* aero */
.icheckbox_minimal-aero,
.iradio_minimal-aero {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/aero.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-aero {
    background-position: 0 0;
}
    .icheckbox_minimal-aero.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-aero.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-aero.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-aero.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-aero {
    background-position: -100px 0;
}
    .iradio_minimal-aero.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-aero.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-aero.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-aero.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 3/2),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-aero,
    .iradio_minimal-aero {
        background-image: url(../image/aero@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* grey */
.icheckbox_minimal-grey,
.iradio_minimal-grey {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/grey.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-grey {
    background-position: 0 0;
}
    .icheckbox_minimal-grey.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-grey.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-grey.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-grey.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-grey {
    background-position: -100px 0;
}
    .iradio_minimal-grey.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-grey.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-grey.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-grey.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-grey,
    .iradio_minimal-grey {
        background-image: url(../image/grey@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* orange */
.icheckbox_minimal-orange,
.iradio_minimal-orange {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/orange.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-orange {
    background-position: 0 0;
}
    .icheckbox_minimal-orange.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-orange.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-orange.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-orange.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-orange {
    background-position: -100px 0;
}
    .iradio_minimal-orange.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-orange.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-orange.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-orange.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-orange,
    .iradio_minimal-orange {
        background-image: url(../image/orange@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* yellow */
.icheckbox_minimal-yellow,
.iradio_minimal-yellow {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/yellow.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-yellow {
    background-position: 0 0;
}
    .icheckbox_minimal-yellow.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-yellow.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-yellow.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-yellow.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-yellow {
    background-position: -100px 0;
}
    .iradio_minimal-yellow.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-yellow.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-yellow.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-yellow.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-yellow,
    .iradio_minimal-yellow {
        background-image: url(../image/yellow@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* pink */
.icheckbox_minimal-pink,
.iradio_minimal-pink {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/pink.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-pink {
    background-position: 0 0;
}
    .icheckbox_minimal-pink.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-pink.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-pink.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-pink.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-pink {
    background-position: -100px 0;
}
    .iradio_minimal-pink.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-pink.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-pink.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-pink.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-pink,
    .iradio_minimal-pink {
        background-image: url(../image/pink@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

/* purple */
.icheckbox_minimal-purple,
.iradio_minimal-purple {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 18px;
    height: 18px;
    background: url(../image/purple.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_minimal-purple {
    background-position: 0 0;
}
    .icheckbox_minimal-purple.hover {
        background-position: -20px 0;
    }
    .icheckbox_minimal-purple.checked {
        background-position: -40px 0;
    }
    .icheckbox_minimal-purple.disabled {
        background-position: -60px 0;
        cursor: default;
    }
    .icheckbox_minimal-purple.checked.disabled {
        background-position: -80px 0;
    }

.iradio_minimal-purple {
    background-position: -100px 0;
}
    .iradio_minimal-purple.hover {
        background-position: -120px 0;
    }
    .iradio_minimal-purple.checked {
        background-position: -140px 0;
    }
    .iradio_minimal-purple.disabled {
        background-position: -160px 0;
        cursor: default;
    }
    .iradio_minimal-purple.checked.disabled {
        background-position: -180px 0;
    }

/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (-moz-min-device-pixel-ratio: 1.5),
       only screen and (-o-min-device-pixel-ratio: 1.5),
       only screen and (min-device-pixel-ratio: 1.5) {
    .icheckbox_minimal-purple,
    .iradio_minimal-purple {
        background-image: url(../image/purple@2x.png);
        -webkit-background-size: 200px 20px;
        background-size: 200px 20px;
    }
}

源码过多,暂不一一列举,需要的朋友可以私信我获取(此源码需收取少量费用)

相关推荐
芭拉拉小魔仙7 分钟前
浏览器数据存储方法深度剖析:LocalStorage、IndexedDB、Cookies、OPFS 与 WASM - SQLite
数据库·sqlite·wasm
KevinAha10 分钟前
django 实战(python 3.x/django 3/sqlite)
python·django·sqlite
是十一月末42 分钟前
Python语法之正则表达式详解以及re模块中的常用函数
开发语言·python·正则表达式
灵封~1 小时前
PythonQt练习
python
pzx_0012 小时前
【时间序列预测】基于Pytorch实现CNN_LSTM算法
人工智能·pytorch·python·算法·cnn·lstm
@半良人2 小时前
Python迭代器-大数据量的处理
python
hakesashou2 小时前
python中什么是驼峰法
python
工业互联网专业3 小时前
Python毕业设计选题:基于大数据的淘宝电子产品数据分析的设计与实现-django+spark+spider
大数据·python·数据分析·spark·django·课程设计·spider
fc&&fl4 小时前
python+docker实现分布式存储的demo
开发语言·python·docker
叫我:松哥6 小时前
基于Python 哔哩哔哩网站热门视频数据采集与可视化分析设计与实现,有聚类有网络语义研究
开发语言·python·信息可视化·网络爬虫·matplotlib·聚类分析·网络语义分析