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']

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2022-01-18
  • 2021-11-07
  • 2021-04-27
  • 2021-08-24
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2021-09-26
  • 2021-11-21
  • 2021-07-04
  • 2021-09-16
  • 2021-05-08
相关资源
相似解决方案