为什么我没有明确指定解析器。代码中会做出哪些更改?

时间:2017-05-01 11:26:43

标签: python-2.7 beautifulsoup

RigidBody.velocity == Vector3.zero

获得此警告: BeautifulSoup([你的标记]) 对此: BeautifulSoup([你的标记]," lxml") MARKUP_TYPE = MARKUP_TYPE))

1 个答案:

答案 0 :(得分:0)

BeautifulSoup需要知道要解析的内容 你给的东西可能是html,也许是xml, 两者都有一些不同的结构 因此,在函数的第二个参数中,您需要指定给定文档是html / xml还是其他

from bs4 import BeautifulSoup
src='"<html>data<//html>"'
soup=BeautifulSoup(src,"html.parser")