我正在尝试在该网站上获取股息收益率(https://www.set.or.th/set/companyprofile.do?symbol=FTREIT&ssoPageId=4&language=en&country=US)
但它被包裹在“col-xs-9 col-md-5”中,并且出现了多次。
有一段文字“Dvd. Yield(%)”只出现一次。
我知道如何搜索“Dvd. Yield(%)”,但不知道如何找到具有数字股息收益率数字的下一行。
python初学者,非常感谢您的建议!提前一百万谢谢!
import requests
from bs4 import BeautifulSoup
URL = 'https://www.set.or.th/set/companyprofile.do?symbol=FTREIT&ssoPageId=4&language=en&country=US'
page = requests.get(URL)
print(page)
soup = BeautifulSoup(page.content, 'html.parser')
results = soup.find_all('Dvd. Yield(%)')