网页信息数据-数据分析(6)
import urllib.request; from bs4 import BeautifulSoup; response = urllib.request.urlopen("file:///C:/Users/junwei_zhou/Desktop/502/6.1/html.html"); html = response.read(); html soup = BeautifulSoup(html,"lxml"); soup soup.find(‘tr‘); soup.find_all(‘tr‘);
处理json数据
# -*- coding: utf-8 -*- import json; import urllib.request; response = urllib.request.urlopen(‘file:///D:/PA//6.2//json.json‘); jsonString = response.read(); jsonObject = json.loads(jsonString.decode()) jsonObject[‘employees‘] jsonObject[‘employees‘][0] jsonObject[‘employees‘][0][‘lastName‘]
相关推荐
WebVincent 2020-07-21
baijinswpu 2020-06-28
88483063 2020-06-28
fengchao000 2020-06-16
somebodyoneday 2020-06-15
wujiajax 2020-06-14
somebodyoneday 2020-05-16
xx0cw 2020-05-16
newthon 2020-05-14
sailxu00 2020-04-27
fengchao000 2020-04-20
88483063 2020-01-29
83163452 2020-01-28
baijinswpu 2020-01-25
baijinswpu 2020-01-18
fengchao000 2020-01-02