【发布时间】:2016-12-17 09:41:38
【问题描述】:
我正在尝试使用 BeautifulSoup 在网站上获取具有特殊 ID 的号码。这是我的代码
from urllib2 import urlopen
from bs4 import BeautifulSoup
import requests, logging
logging.basicConfig()
html = urlopen("http://example.com")
bsObj = BeautifulSoup(str(html), "html.parser")
select = bsObj.findAll(id="myid")
print(select.get_text())
但我得到了“AttributeError:“ResultSet”对象没有属性“get_text”。 问题出在哪里?
【问题讨论】:
标签: python beautifulsoup