您好,我有一个网站报废这个网址的问题我已经在我的代码编辑器中写了它,但也在cmd中这样做,因为我一直在努力确保我做对了。我遇到了一个问题:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'h1'
我也做了'p',看看它是否可以从页面上得到一个段落,但这也不值得。请检查上述问题。
谢谢你的帮助
改变这个:
page_soup = (uClient.read(), "html.parser")
至:
page_soup = soup(uClient.read(), "html.parser")
它创建了BeautifulSoup对象。