链接二手房数据可视化
使用python3.7对链家网中广州二手房的交易数据进行爬取,并使用python-highcharts对爬取到的数据进行可视化分析。 首先,配置需要的环境: 打开终端cmd,进入pip所在的目录,安装python-highcharts库: pip install python-highcharts 对链家网进行数据爬虫,得到json格式的数据: LianJia_by_json.py from selenium import webdriver from bs4 import BeautifulSoup import re import xlwt import urllib import json import os import time class spider: def __init__(self,driver): self.driver = driver self.chengjiao_info_dict = {} self.href_list = [] self.classification_dict = {} # self.data_json_file = 'LianJia_'+time.strftime("%Y_%m_%d_%H_%M_%S", time.localtime())+'.json' # print(self.data_json_file) # exit(0)