网页信息数据-数据分析(6)

时间:2020-07-04 23:03:21   收藏:0   阅读:67
import urllib.request;
from bs4 import BeautifulSoup;

response = urllib.request.urlopen("file:///C: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]

 

原文:https://www.cnblogs.com/topass123/p/13236933.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!