之前安装一直使用没问题,昨天想着装个股票的模块,没成功
结果发现之前使用 bs 的脚本执行报错了.
我手动测试了下,发现现在 bs 现在无法解析任何网页了.
如何排查错误,我尝试重新安装了,发现没什么用.
重新安装了 python-lxml 也没什么卵用,如何解决?
多谢各位了
>>> from bs4 import BeautifulSoup
>>> html = """
... <html><head><title>The Dormouse's story</title></head>
... <body>
... <p class="title" name="dromouse"><b>The Dormouse's story</b></p>
... <p class="story">Once upon a time there were three little sisters; and their names were
... <a href="http://example.com/elsie" class="sister" id="link1"><!-- Elsie --></a>,
... <a href="http://example.com/lacie" class="sister" id="link2">Lacie</a> and
... <a href="http://example.com/tillie" class="sister" id="link3">Tillie</a>;
... and they lived at the bottom of a well.</p>
... <p class="story">...</p>
... """
>>> soup = BeautifulSoup(html)
>>> print soup
>>>
结果发现之前使用 bs 的脚本执行报错了.
我手动测试了下,发现现在 bs 现在无法解析任何网页了.
如何排查错误,我尝试重新安装了,发现没什么用.
重新安装了 python-lxml 也没什么卵用,如何解决?
多谢各位了
>>> from bs4 import BeautifulSoup
>>> html = """
... <html><head><title>The Dormouse's story</title></head>
... <body>
... <p class="title" name="dromouse"><b>The Dormouse's story</b></p>
... <p class="story">Once upon a time there were three little sisters; and their names were
... <a href="http://example.com/elsie" class="sister" id="link1"><!-- Elsie --></a>,
... <a href="http://example.com/lacie" class="sister" id="link2">Lacie</a> and
... <a href="http://example.com/tillie" class="sister" id="link3">Tillie</a>;
... and they lived at the bottom of a well.</p>
... <p class="story">...</p>
... """
>>> soup = BeautifulSoup(html)
>>> print soup
>>>