def yahoo_stock_info(self, ticker):
r = requests.get('http://finance.yahoo.com/quote/AAPL?p=' + ticker)
soup = BeautifulSoup(r.text)
tables = soup.find_all('table')[1:] # drop the first useless table
# curl 'https://query2.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=summaryProfile%2CfinancialData%2CrecommendationTrend%2CupgradeDowngradeHistory%2Cearnings%2CdefaultKeyStatistics%2CcalendarEvents' | python -m json.tool > tmp2.txt
print(soup.prettify())
import pytest
pytest.set_trace()
评论列表
文章目录