Python中文
首页
教程
问答
标签
搜索
登录
注册
如何格式化凌乱的html源代码?python
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我用python编写了使用HTML源代码的代码,使用BeautifulSoup。 我得到的HTML非常混乱。如何使HTML源代码看起来很好?你知道吗</p> <p>这是<a href="https://tulanehullabaloo.com/31772/no-photo/czech-elections-us-frustration/" rel="nofollow noreferrer">website</a></p> <p>这就是我如何获取html源代码(其中的一部分):</p> <pre><code> property="article:tag" content="ally" /><meta property="article:tag" content="harvey weinstein" /><meta property="article:tag" content="pratiksha parulekar" /><meta property="article:tag" content="rape culture" /><meta property="article:section" content="No Photo" /><meta property="article:published_time" content="2017-10-25T22:28:46-05:00" /><meta property="article:modified_time" content="2017-10-25T22:44:29-05:00" /><meta property="og:updated_time" content="2017-10-25T22:44:29-05:00" /><meta name="twitter:card" content="summary" /><meta name="twitter:description" content="For men, professing disgust at sexual assault allegations is not sufficient; male allies must also hold friends who harass women accountable." /><meta name="twitter:title" content="To combat sexual harassment, men must hold peers accountable &bull; The Tulane Hullabaloo" /><link rel='dns-prefetch' href='//cdn.jsdelivr.net' /><link rel='dns-prefetch' href='//maxcdn.bootstrapcdn.com' /><link rel='dns-prefetch' href='//fonts.googleapis.com' /><link rel='dns-prefetch' href='//s.w.org' /><link </code></pre> <p>我能做什么?你知道吗</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>你可能在找<a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/#pretty-printing" rel="nofollow noreferrer">the doc</a></p> <pre><code>print(yoursoup.prettify()) </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Python中是否有类似Clojure的线程宏?
1 回答
Python中是否有类似JPanel的组件?
1 回答
Python中是否有类似MATLAB的vpasolve的等价解算器
1 回答
python中是否有类似NLTK的东西不需要安装?
10 回答
python中是否有类似osgi在java中试图解决的需求?
8 回答
python中是否有类似PAM的模块?
1 回答
Python中是否有类似Perl的Data::Dumper的工具用来检查数据结构?
10 回答
python中是否有类似robocy的函数,带有重试选项?
9 回答
Python中是否有类似Rstudio的帮助部分?
7 回答
python中是否有类似ruby的索引方法?
9 回答
python中是否有类似于“perlpe”选项的内容?
3 回答
Python中是否有类似于C++ STL映射的结构?
6 回答
python中是否有类似于C中预处理器行为的工具?
1 回答
Python中是否有类似于Harmony的let关键字的内容?
7 回答
python中是否有类似于matlab中fzero的函数?
7 回答
python中是否有类似于MATLAB中peaks(N)的函数/实现?
9 回答
Python中是否有类似于Matlab的deconvblind的函数?
5 回答
Python中是否有类似于Perl中“想要”的东西
3 回答
Python中是否有类似于Perl正则表达式中的"local"变量?
4 回答
python中是否有类似于php的$$变量的语法
9 回答