dtの「投資を求めた」テキストを省略して、ddで「£70,004」テキストを抽出するにはどうすればよいですか。
from bs4 import BeautifulSoup
import urllib2
url="https://www.seedrs.com/tanorganic"
page = urllib2.urlopen(url)
soup = BeautifulSoup(page.read(), "html.parser")
target = soup.find("dl", class_="investment_sought").text
print target
figure = soup.find("dd", class_="investment_sought").text
print figure
結果 :
Investment
sought:
£70,004
Traceback (most recent call last):
File "testing.py", line 12, in <module>
figure = soup.find("dd", class_="investment_sought").text
AttributeError: 'NoneType' object has no attribute 'text'