【发布时间】:2023-03-20 15:45:01
【问题描述】:
我试图为下面的 HTML 表配置一个解析树,但无法形成它。我想看看树结构的样子!有人可以帮我吗?
# <html>
# <head>
# <title>
# The Dormouse's story
# </title>
# </head>
# <body>
# <p class="title">
# <b>
# The Dormouse's story
# </b>
# </p>
# <p class="story">
# Once upon a time there were three little sisters; and their names were
# <a class="sister" href="http://example.com/elsie" id="link1">
# Elsie
# </a>
# ,
# <a class="sister" href="http://example.com/lacie" id="link2">
# Lacie
# </a>
# and
# <a class="sister" href="http://example.com/tillie" id="link2">
# Tillie
# </a>
# ; and they lived at the bottom of a well.
# </p>
# <p class="story">
# ...
# </p>
# </body>
# </html>
编辑
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\matt>easy_install ete2
Searching for ete2
Reading http://pypi.python.org/simple/ete2/
Reading http://ete.cgenomics.org
Reading http://ete.cgenomics.org/releases/ete2/
Reading http://ete.cgenomics.org/releases/ete2
Best match: ete2 2.1rev539
Downloading http://ete.cgenomics.org/releases/ete2/ete2-2.1rev539.tar.gz
Processing ete2-2.1rev539.tar.gz
Running ete2-2.1rev539\setup.py -q bdist_egg --dist-dir c:\users\arupra~1\appdat
a\local\temp\easy_install-sypg3x\ete2-2.1rev539\egg-dist-tmp-zemohm
Installing ETE (A python Environment for Tree Exploration).
Checking dependencies...
numpy cannot be found in your python installation.
Numpy is required for the ArrayTable and ClusterTree classes.
MySQLdb cannot be found in your python installation.
MySQLdb is required for the PhylomeDB access API.
PyQt4 cannot be found in your python installation.
PyQt4 is required for tree visualization and image rendering.
lxml cannot be found in your python installation.
lxml is required from Nexml and Phyloxml support.
However, you can still install ETE without such functionality.
Do you want to continue with the installation anyway? [y,n]y
Your installation ID is: d33ba3b425728e95c47cdd98acda202f
warning: no files found matching '*' under directory '.'
warning: no files found matching '*.*' under directory '.'
warning: manifest_maker: MANIFEST.in, line 4: path 'doc/ete_guide/' cannot end w
ith '/'
warning: manifest_maker: MANIFEST.in, line 5: path 'doc/' cannot end with '/'
warning: no previously-included files matching '*.pyc' found under directory '.'
zip_safe flag not set; analyzing archive contents...
Adding ete2 2.1rev539 to easy-install.pth file
Installing ete2 script to C:\Python27\Scripts
Installed c:\python27\lib\site-packages\ete2-2.1rev539-py2.7.egg
Processing dependencies for ete2
Finished processing dependencies for ete2
【问题讨论】:
-
@Oded,我猜是用 python:)
-
@Oded 我只是想看看它的树形结构是什么样子的。基本上我正在使用 python 包,它将
htmldoc 作为解析树处理。所以我想看看它的树结构。因此,如果您能提供同样的帮助,我会有所帮助! -
我不能,因为我不是 python 人(现在你现在为什么应该用语言标记问题)。我也不清楚您希望如何查看解析树 - 您也需要对此进行扩展。
-
@Oded 只是我想看看它在
tree like structure中的样子?而已。不需要像树一样在 python 中。 python 也以标准方式生成它。它应该是一个自顶向下的解析树 -
为什么不编辑问题并将这些详细信息添加到其中?
标签: python python-2.7 beautifulsoup parse-tree etetoolkit