2020
12-07
12-07
python爬虫beautifulsoup解析html方法
用BeautifulSoup解析html和xml字符串实例:#!/usr/bin/python#-*-coding:UTF-8-*-frombs4importBeautifulSoupimportre#待分析字符串html_doc="""<html><head><title>TheDormouse'sstory</title></head><body><pclass="titleaq"><b>TheDormouse'sstory</b></p><pclass="story">Onceuponatimetherewerethreelittlesisters;andtheirnameswere<ahref="http://example.com/elsie"rel="exte...
继续阅读 >