Python_Notes
  • 介绍
  • Basic Syntax
    • __init__.py的作用
    • 注释规范
    • 命名规范
    • 特殊方法
      • __str__和__repr
      • __len__
    • temp
    • 注解 Decorator
  • Standard Modules
    • os
    • subprocess
    • shlex
    • sys
    • ftplib
  • Python Web
    • Django
      • 创建项目
      • 创建应用
        • 安装应用
        • 编写应用视图
          • 页面模板
            • 用法
            • 内置后端
          • Django模板语言
            • 变量
            • 标记
            • 过滤器
            • 注释
      • 模型
        • 创建模型
        • 模型字段类型
        • 配置数据库
      • 打开网站
      • 管理模块
      • 视图
        • 基于类的视图
      • message
      • auth
    • web.py
    • 规范WSGI
    • flask
  • Python BigData
    • sklearn
      • Preprocessing预处理
        • MinMaxScaler
          • minmax_scale
        • FunctionTransformer
        • Imputer
        • KernelCenterer
        • add_dummy_feature
        • Binarize
        • Normalizer
        • Scale
          • StandardScaler
        • OneHotEncoder
      • Feature Selection特征选择
        • SelectKBest
        • SelectPercentile
        • ...
      • Estimator预测器
        • Regression
        • Clustering
        • Classification
          • Trees
            • DecisionTree
            • ExtraTree
          • Naive Bayes
            • Gaussian Naive Bayes
            • Multinomial Naive Bayes
            • Bernoulli Naive Bayes
            • Out-of-core naive Bayes model fitting
          • Nearest Neighbors
            • KDTree和BallTree类
          • Gaussian Processes
          • Cross decomposition
      • 算法融合
        • Bagging meta-estimator
        • Forests of randomized trees
        • AdaBoost
        • Gradient Tree Boosting
        • Voting Classifier
      • Pipeline管道
        • FeatureUnion
          • make_union
        • Pipeline
          • make_pipeline
      • Model Selection模型选择,算法评估
    • NumPy
      • 基本
      • 数组创建
    • SciPy
    • matplotlib
  • Python Spider
    • 反爬虫
    • requests
      • response
      • data
      • head
      • session
      • 配置
      • exceptions
    • BeautifulSoup
      • 对象
        • Tag
        • NavigableString
        • BeautifulSoup
        • Comment
      • 遍历文档树
        • 子节点
          • tag的名字
          • .contents 和 .children
          • .descendants
          • .string
          • .strings 和 stripped_strings
        • 父节点
          • .parent
          • .parents
        • 兄弟节点
          • .next_sibling 和 .previous_sibling
          • .next_siblings 和 .previous_siblings
          • 回退和前进
          • .next_element 和 .previous_element
          • .next_elements 和 .previous_elements
      • 搜索文档树
        • CSS选择器
        • 过滤器
          • 字符串
          • 正则表达式
          • 列表
          • True
          • 方法
        • find_all()
          • name参数
          • keyword参数
          • 按CSS搜索
          • string参数
          • limit参数
          • recursive 参数
        • 像调用 find_all() 一样调用tag
        • find()
        • find_parents() 和 find_parent()
        • find_next_siblings() 合 find_next_sibling()
        • find_previous_siblings() 和 find_previous_sibling()
        • find_previous_siblings() 和 find_previous_sibling()
        • find_all_next() 和 find_next()
        • find_all_next() 和 find_next()
        • find_all_next() 和 find_next()
        • find_all_next() 和 find_next()
        • find_all_previous() 和 find_previous()
      • 修改文档树
        • 修改tag的名称和属性
        • 修改 .string
        • append()
        • NavigableString() 和 .new_tag()
        • insert()
        • insert_before() 和 insert_after()
        • clear()
        • extract()
        • decompose()
        • replace_with()
        • wrap()
        • unwrap()
    • selenium
      • 定位元素
        • 通过id
        • 通过class
        • 通过name
        • 通过XPath
        • 通过链接文本定位链接
        • 通过标签名
        • 使用css选择器
      • 对元素进行操作
        • key
      • 等待
        • 显示等待
        • 隐式等待
      • WebDriver
        • 异常
      • exceptions
    • scrapy
      • 安装
      • 创建项目
      • 基本概念
        • Spiders
          • scrapy.Spider
          • Spider arguments
          • Generic Spiders
            • CrawlSpider
            • XMLFeedSpider
            • CSVSpider
            • SitemapSider
        • Selector
        • Items
        • Item Loaders
        • Scrapy Shell
        • Item Pipeline
        • Feed exports
        • Requests
        • Responses
        • Link Extractors
        • Settings
        • Exceptions
        • Command line tool
      • 内置服务
  • Python Hacker
    • python-nmap
      • nmap软件使用手册
        • hhhh
          • 全面扫描
        • 主机发现
        • 端口扫描
        • 服务和版本探测
        • 操作系统探测
        • 时间与性能
        • 输出
        • 其他
      • sdfsdf
    • pexpect
      • spawn类
        • expect方法
        • read方法
        • send方法
        • run方法
      • pxssh类
    • pywifi 处理wifi
    • socket
    • Metasploit
    • ftplib
  • Other Packages
    • tqdm 显示进度
    • win32
    • pytube下载视频
    • SQLite
    • optparse 处理脚本的选项
    • 处理微信的
      • ItChat
        • 给文件传输助手发一条信息
        • Untitled
      • wxpy
      • prettytable
  • Debug
    • PDB
    • PyDev
    • 日志功能
  • inside Packages
    • re
  • Python APP
Powered by GitBook
On this page
  1. Python Spider
  2. BeautifulSoup
  3. 修改文档树

clear()

Previousinsert_before() 和 insert_after()Nextextract()

Last updated 7 years ago