{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import sys\n", "sys.path.append(\"../../FinNLP\")" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### CNBS" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.cnbc_streaming import CNBC_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading ... 0 1 2 " ] } ], "source": [ "news_downloader = CNBC_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(30, 30)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.shape" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['description', 'cn:lastPubDate', 'dateModified', 'cn:dateline',\n", " 'cn:branding', 'section', 'cn:type', 'author', 'cn:source',\n", " 'cn:subtype', 'duration', 'summary', 'expires', 'cn:sectionSubType',\n", " 'cn:contentClassification', 'pubdateunix', '_id', 'url', '@id',\n", " 'datePublished', 'cn:promoImage', 'cn:title', 'cn:keyword',\n", " 'cn:liveURL', '_pubDate', '_type', '_index', 'brand', 'hint',\n", " 'hint_detail'],\n", " dtype='object')" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.columns" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
descriptioncn:lastPubDatedateModifiedcn:datelinecn:brandingsectioncn:typeauthorcn:sourcecn:subtype...cn:promoImagecn:titlecn:keywordcn:liveURL_pubDate_type_indexbrandhinthint_detail
0While Leah Ellis was earning her doctorate at ...2023-06-24T10:00:01+00002023-06-24T10:00:01+0000cnbcClean TechcnbcnewsstoryCatherine Clifford[]...https://image.cnbcfm.com/api/v1/image/10726095...Meet the 33-year-old Canadian chemist and the ...https://www.cnbc.com/2023/06/24/sublime-system...6/24/2023 10:00:01 PM00cnbcNaNNaN
1Amazon.com said on Friday it will take its inv...2023-06-24T04:50:41+00002023-06-24T04:50:41+0000cnbcTechnologywirestory[]...https://image.cnbcfm.com/api/v1/image/10726178...Amazon raises investment in India to $26 billi...https://www.cnbc.com/2023/06/24/amazon-commits...6/24/2023 1:49:10 PM01cnbcNaNNaN
\n", "

2 rows × 30 columns

\n", "
" ], "text/plain": [ " description \\\n", "0 While Leah Ellis was earning her doctorate at ... \n", "1 Amazon.com said on Friday it will take its inv... \n", "\n", " cn:lastPubDate dateModified cn:dateline cn:branding \\\n", "0 2023-06-24T10:00:01+0000 2023-06-24T10:00:01+0000 cnbc \n", "1 2023-06-24T04:50:41+0000 2023-06-24T04:50:41+0000 cnbc \n", "\n", " section cn:type author cn:source cn:subtype ... \\\n", "0 Clean Tech cnbcnewsstory Catherine Clifford [] ... \n", "1 Technology wirestory [] ... \n", "\n", " cn:promoImage \\\n", "0 https://image.cnbcfm.com/api/v1/image/10726095... \n", "1 https://image.cnbcfm.com/api/v1/image/10726178... \n", "\n", " cn:title cn:keyword \\\n", "0 Meet the 33-year-old Canadian chemist and the ... \n", "1 Amazon raises investment in India to $26 billi... \n", "\n", " cn:liveURL _pubDate \\\n", "0 https://www.cnbc.com/2023/06/24/sublime-system... 6/24/2023 10:00:01 PM \n", "1 https://www.cnbc.com/2023/06/24/amazon-commits... 6/24/2023 1:49:10 PM \n", "\n", " _type _index brand hint hint_detail \n", "0 0 0 cnbc NaN NaN \n", "1 0 1 cnbc NaN NaN \n", "\n", "[2 rows x 30 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.head(2)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
datePublishedcn:lastPubDatedateModifieddescriptionsectionauthorsummarycn:titlecn:type
02023-06-24T14:00:01+00002023-06-24T10:00:01+00002023-06-24T10:00:01+0000While Leah Ellis was earning her doctorate at ...Clean TechCatherine CliffordSublime Systems is scaling up a green cement. ...Meet the 33-year-old Canadian chemist and the ...cnbcnewsstory
12023-06-24T05:49:10+00002023-06-24T04:50:41+00002023-06-24T04:50:41+0000Amazon.com said on Friday it will take its inv...TechnologyModi and Jassy spoke about supporting Indian s...Amazon raises investment in India to $26 billi...wirestory
22023-06-23T22:12:07+00002023-06-23T18:29:45+00002023-06-23T18:29:45+0000As Microsoft attempts to convince regulators t...TechnologyJordan NovetMicrosoft has been eager to grow in mobile gam...Microsoft says it looked at acquiring Zynga bu...cnbcnewsstory
32023-06-23T21:51:15+00002023-06-23T17:51:15+00002023-06-23T17:51:15+0000The CEOs of Apple, Alphabet, Microsoft got a h...TechnologySeema ModyTop tech execs met with Indian Prime Minister ...Apple's Tim Cook calls India 'huge opportunity...cnbcnewsstory
42023-06-23T17:32:48+00002023-06-23T13:36:59+00002023-06-23T13:36:59+0000Tech executives like Apple CEO Tim Cook visit ...Fast Money Halftime ReportSeema ModyTech executives like Apple CEO Tim Cook visit ...Tech CEOs meet President Biden and Indian PM M...cnbcvideo
52023-06-23T12:30:17+00002023-06-23T13:32:42+00002023-06-23T13:32:42+0000Anyone want to buy or sell this tech rally? To...Pro: Pro ColumnistsBob PisaniFollowing the rebalancing of S&P indexes last ...Friday could offer a once-in-a-year chance to ...cnbcnewsstory
62023-06-23T12:26:42+00002023-06-23T11:47:06+00002023-06-23T11:47:06+0000Here are Friday's biggest calls on Wall Street...Pro: Analyst Stock PicksMichael BloomHere are Friday's biggest calls on Wall Street.Here are Friday's biggest analyst calls: Meta,...cnbcnewsstory
72023-06-23T06:30:01+00002023-06-23T02:30:01+00002023-06-23T02:30:01+0000This report is from today's CNBC Daily Open, o...Daily OpenYeo Boon PingInvestors have been lulled by a sense of secur...CNBC Daily Open: Seeking shelter in techcnbcnewsstory
82023-06-23T05:45:33+00002023-06-23T10:37:42+00002023-06-23T10:37:42+0000AMSTERDAM — Artificial intelligence has a raci...TechnologyRyan BrowneWhen it comes to banking and financial service...A.I. has a discrimination problem. In banking,...cnbcnewsstory
92023-06-22T23:43:01+00002023-06-23T01:01:10+00002023-06-23T01:01:10+0000This report is from today's CNBC Daily Open, o...Daily OpenYeo Boon PingInvestors have been lulled by a sense of secur...CNBC Daily Open: Rate hikes and red lightscnbcnewsstory
\n", "
" ], "text/plain": [ " datePublished cn:lastPubDate \\\n", "0 2023-06-24T14:00:01+0000 2023-06-24T10:00:01+0000 \n", "1 2023-06-24T05:49:10+0000 2023-06-24T04:50:41+0000 \n", "2 2023-06-23T22:12:07+0000 2023-06-23T18:29:45+0000 \n", "3 2023-06-23T21:51:15+0000 2023-06-23T17:51:15+0000 \n", "4 2023-06-23T17:32:48+0000 2023-06-23T13:36:59+0000 \n", "5 2023-06-23T12:30:17+0000 2023-06-23T13:32:42+0000 \n", "6 2023-06-23T12:26:42+0000 2023-06-23T11:47:06+0000 \n", "7 2023-06-23T06:30:01+0000 2023-06-23T02:30:01+0000 \n", "8 2023-06-23T05:45:33+0000 2023-06-23T10:37:42+0000 \n", "9 2023-06-22T23:43:01+0000 2023-06-23T01:01:10+0000 \n", "\n", " dateModified \\\n", "0 2023-06-24T10:00:01+0000 \n", "1 2023-06-24T04:50:41+0000 \n", "2 2023-06-23T18:29:45+0000 \n", "3 2023-06-23T17:51:15+0000 \n", "4 2023-06-23T13:36:59+0000 \n", "5 2023-06-23T13:32:42+0000 \n", "6 2023-06-23T11:47:06+0000 \n", "7 2023-06-23T02:30:01+0000 \n", "8 2023-06-23T10:37:42+0000 \n", "9 2023-06-23T01:01:10+0000 \n", "\n", " description \\\n", "0 While Leah Ellis was earning her doctorate at ... \n", "1 Amazon.com said on Friday it will take its inv... \n", "2 As Microsoft attempts to convince regulators t... \n", "3 The CEOs of Apple, Alphabet, Microsoft got a h... \n", "4 Tech executives like Apple CEO Tim Cook visit ... \n", "5 Anyone want to buy or sell this tech rally? To... \n", "6 Here are Friday's biggest calls on Wall Street... \n", "7 This report is from today's CNBC Daily Open, o... \n", "8 AMSTERDAM — Artificial intelligence has a raci... \n", "9 This report is from today's CNBC Daily Open, o... \n", "\n", " section author \\\n", "0 Clean Tech Catherine Clifford \n", "1 Technology \n", "2 Technology Jordan Novet \n", "3 Technology Seema Mody \n", "4 Fast Money Halftime Report Seema Mody \n", "5 Pro: Pro Columnists Bob Pisani \n", "6 Pro: Analyst Stock Picks Michael Bloom \n", "7 Daily Open Yeo Boon Ping \n", "8 Technology Ryan Browne \n", "9 Daily Open Yeo Boon Ping \n", "\n", " summary \\\n", "0 Sublime Systems is scaling up a green cement. ... \n", "1 Modi and Jassy spoke about supporting Indian s... \n", "2 Microsoft has been eager to grow in mobile gam... \n", "3 Top tech execs met with Indian Prime Minister ... \n", "4 Tech executives like Apple CEO Tim Cook visit ... \n", "5 Following the rebalancing of S&P indexes last ... \n", "6 Here are Friday's biggest calls on Wall Street. \n", "7 Investors have been lulled by a sense of secur... \n", "8 When it comes to banking and financial service... \n", "9 Investors have been lulled by a sense of secur... \n", "\n", " cn:title cn:type \n", "0 Meet the 33-year-old Canadian chemist and the ... cnbcnewsstory \n", "1 Amazon raises investment in India to $26 billi... wirestory \n", "2 Microsoft says it looked at acquiring Zynga bu... cnbcnewsstory \n", "3 Apple's Tim Cook calls India 'huge opportunity... cnbcnewsstory \n", "4 Tech CEOs meet President Biden and Indian PM M... cnbcvideo \n", "5 Friday could offer a once-in-a-year chance to ... cnbcnewsstory \n", "6 Here are Friday's biggest analyst calls: Meta,... cnbcnewsstory \n", "7 CNBC Daily Open: Seeking shelter in tech cnbcnewsstory \n", "8 A.I. has a discrimination problem. In banking,... cnbcnewsstory \n", "9 CNBC Daily Open: Rate hikes and red lights cnbcnewsstory " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"datePublished\", \"cn:lastPubDate\", \"dateModified\", \"description\", \"section\" ,\"author\", \"summary\" , \"cn:title\", \"cn:type\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Yicai / 第一财经" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.yicai_streaming import Yicai_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading ... 0 1 2 " ] } ], "source": [ "news_downloader = Yicai_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"茅台\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(60, 13)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.shape" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
authorchannelidcreationDatedescidpreviewImagesourcetagstitletopicstypeourlweight
010000032006-21 11:41101788593第一财经北斗星通;游资;龙虎;买入;通信机构抄底超讯通信 游资封板北斗星通丨龙虎榜10/news/101788593.html50
1[周艾琳]5306-20 21:552003年7月,第一家QFII瑞银宣布买入宝钢股份 、上港集箱等4只蓝筹公司股票,受到了国内...1017881832023/06/e42c4bda8cc367f523764c90447ab5a3.jpg第一财经外资;A股;基金;QFII;RQFII;瑞银QFII投资A股走过20年,外资驶向何方?10/news/101788183.html50
\n", "
" ], "text/plain": [ " author channelid creationDate \\\n", "0 100000320 06-21 11:41 \n", "1 [周艾琳] 53 06-20 21:55 \n", "\n", " desc id \\\n", "0 101788593 \n", "1 2003年7月,第一家QFII瑞银宣布买入宝钢股份 、上港集箱等4只蓝筹公司股票,受到了国内... 101788183 \n", "\n", " previewImage source \\\n", "0 第一财经 \n", "1 2023/06/e42c4bda8cc367f523764c90447ab5a3.jpg 第一财经 \n", "\n", " tags title topics typeo \\\n", "0 北斗星通;游资;龙虎;买入;通信 机构抄底超讯通信 游资封板北斗星通丨龙虎榜 10 \n", "1 外资;A股;基金;QFII;RQFII;瑞银 QFII投资A股走过20年,外资驶向何方? 10 \n", "\n", " url weight \n", "0 /news/101788593.html 50 \n", "1 /news/101788183.html 50 " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.head(2)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
authorcreationDatedescsourcetitle
006-21 11:41第一财经机构抄底超讯通信 游资封板北斗星通丨龙虎榜
1[周艾琳]06-20 21:552003年7月,第一家QFII瑞银宣布买入宝钢股份 、上港集箱等4只蓝筹公司股票,受到了国内...第一财经QFII投资A股走过20年,外资驶向何方?
206-20 11:46第一财经北向资金抄底贵州<i>茅台</i> 游资联手封板中远海科丨龙虎榜
306-20 11:45第一财经22股获北向资金加仓超亿元
406-20 11:36第一财经北向资金抄底贵州<i>茅台</i> 游资联手封板中远海科丨龙虎榜
506-20 06:23第一财经每日早间精选热点新闻,点击「听新闻」,一键收听。第一财经布林肯结束访华,外交部美大司司长介绍情况;2023高考网上咨询周时间安排公布丨早报
6[第一财经]06-19 19:06今日股市0619丨50大跌小票指数强势 分化局面会否延续?
706-19 19:05第一财经今日股市0619丨50大跌小票指数强势 分化局面会否延续?
8[一财资讯]06-19 17:46净买入额居前三的是贵州<i>茅台</i>、药明康德、新易盛,分别获净买入3.48亿元、3.3...第一财经北向资金净卖出14.47亿元,贵州<i>茅台</i>、药明康德等获加仓
906-19 15:39第一财经三大指数小幅收跌 TMT赛道持续大涨|尾市盘点
\n", "
" ], "text/plain": [ " author creationDate desc \\\n", "0 06-21 11:41 \n", "1 [周艾琳] 06-20 21:55 2003年7月,第一家QFII瑞银宣布买入宝钢股份 、上港集箱等4只蓝筹公司股票,受到了国内... \n", "2 06-20 11:46 \n", "3 06-20 11:45 \n", "4 06-20 11:36 \n", "5 06-20 06:23 第一财经每日早间精选热点新闻,点击「听新闻」,一键收听。 \n", "6 [第一财经] 06-19 19:06 \n", "7 06-19 19:05 \n", "8 [一财资讯] 06-19 17:46 净买入额居前三的是贵州茅台、药明康德、新易盛,分别获净买入3.48亿元、3.3... \n", "9 06-19 15:39 \n", "\n", " source title \n", "0 第一财经 机构抄底超讯通信 游资封板北斗星通丨龙虎榜 \n", "1 第一财经 QFII投资A股走过20年,外资驶向何方? \n", "2 第一财经 北向资金抄底贵州茅台 游资联手封板中远海科丨龙虎榜 \n", "3 第一财经 22股获北向资金加仓超亿元 \n", "4 第一财经 北向资金抄底贵州茅台 游资联手封板中远海科丨龙虎榜 \n", "5 第一财经 布林肯结束访华,外交部美大司司长介绍情况;2023高考网上咨询周时间安排公布丨早报 \n", "6 今日股市0619丨50大跌小票指数强势 分化局面会否延续? \n", "7 第一财经 今日股市0619丨50大跌小票指数强势 分化局面会否延续? \n", "8 第一财经 北向资金净卖出14.47亿元,贵州茅台、药明康德等获加仓 \n", "9 第一财经 三大指数小幅收跌 TMT赛道持续大涨|尾市盘点 " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"author\", \"creationDate\", \"desc\" ,\"source\", \"title\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Investor Place" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.investorplace_streaming import InvestorPlace_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading ... 0 1 2 " ] } ], "source": [ "news_downloader = InvestorPlace_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titletimeauthorsummary
0[Trillion-Dollar Tech: 3 Stocks Poised for Unp...Jun 19, 2023Faisal Humayun, InvestorPlace ContributorThese are the tech stocks to buy for multibagg...
1[Trillion-Dollar Tech: 3 Stocks Poised for Unp...Jun 22, 2023Chris MacDonald, InvestorPlace ContributorWarren Buffett is undoubtedly one of the great...
2[Invest Like a Billionaire: 3 Long-Term Stocks...Jun 18, 2023Joel Baglole, InvestorPlace ContributorWith markets now recovering from the downturn ...
3[Invest Like a Billionaire: 3 Long-Term Stocks...Jun 16, 2023Louis Navellier and the InvestorPlace Research...The best tech stocks to watch are involved in ...
4[3 Tech Titans Leading the Charge Toward $10 T...Jun 19, 2023Will Ashworth, InvestorPlace ContributorAvoiding bad stocks requires investors to get ...
5[3 Tech Titans Leading the Charge Toward $10 T...Jun 19, 2023Tyrik Torres, InvestorPlace ContributorWhile AI software companies tend to get more b...
6[7 Tech Stocks to Watch Out For in 2023 … and ...Jun 16, 2023Chris MacDonald, InvestorPlace ContributorMany long-term conservative investors pay atte...
7[7 Tech Stocks to Watch Out For in 2023 … and ...Jun 16, 2023Louis Navellier and the InvestorPlace Research...Every stock has its ups and downs, but reliabl...
8[3 Smart Takes on 3 Dumb Stocks]Jun 23, 2023Samuel O'Brient, InvestorPlace Financial News ...Even as tech stocks rally, short sellers are s...
9[3 Smart Takes on 3 Dumb Stocks]Jun 18, 2023Chris Markoch, InvestorPlace ContributorHere are seven high cash flow stocks that prov...
\n", "
" ], "text/plain": [ " title time \\\n", "0 [Trillion-Dollar Tech: 3 Stocks Poised for Unp... Jun 19, 2023 \n", "1 [Trillion-Dollar Tech: 3 Stocks Poised for Unp... Jun 22, 2023 \n", "2 [Invest Like a Billionaire: 3 Long-Term Stocks... Jun 18, 2023 \n", "3 [Invest Like a Billionaire: 3 Long-Term Stocks... Jun 16, 2023 \n", "4 [3 Tech Titans Leading the Charge Toward $10 T... Jun 19, 2023 \n", "5 [3 Tech Titans Leading the Charge Toward $10 T... Jun 19, 2023 \n", "6 [7 Tech Stocks to Watch Out For in 2023 … and ... Jun 16, 2023 \n", "7 [7 Tech Stocks to Watch Out For in 2023 … and ... Jun 16, 2023 \n", "8 [3 Smart Takes on 3 Dumb Stocks] Jun 23, 2023 \n", "9 [3 Smart Takes on 3 Dumb Stocks] Jun 18, 2023 \n", "\n", " author \\\n", "0 Faisal Humayun, InvestorPlace Contributor \n", "1 Chris MacDonald, InvestorPlace Contributor \n", "2 Joel Baglole, InvestorPlace Contributor \n", "3 Louis Navellier and the InvestorPlace Research... \n", "4 Will Ashworth, InvestorPlace Contributor \n", "5 Tyrik Torres, InvestorPlace Contributor \n", "6 Chris MacDonald, InvestorPlace Contributor \n", "7 Louis Navellier and the InvestorPlace Research... \n", "8 Samuel O'Brient, InvestorPlace Financial News ... \n", "9 Chris Markoch, InvestorPlace Contributor \n", "\n", " summary \n", "0 These are the tech stocks to buy for multibagg... \n", "1 Warren Buffett is undoubtedly one of the great... \n", "2 With markets now recovering from the downturn ... \n", "3 The best tech stocks to watch are involved in ... \n", "4 Avoiding bad stocks requires investors to get ... \n", "5 While AI software companies tend to get more b... \n", "6 Many long-term conservative investors pay atte... \n", "7 Every stock has its ups and downs, but reliabl... \n", "8 Even as tech stocks rally, short sellers are s... \n", "9 Here are seven high cash flow stocks that prov... " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"time\" ,\"author\", \"summary\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "\n", "### Guru Focus" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.gurufocus_streaming import GuruFocus_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Only support first page now!\n" ] } ], "source": [ "news_downloader = GuruFocus_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"AAPL\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titleviewsourcedatetime
03 Magic Formula Stocks Popular With Gurus0 ViewsMargaret Moran2023-06-23 17:38
1Jeremy Grantham: The Super Bubble Is About to Pop60 ViewsBen Alaimo2023-06-23 09:21
25 High GF Score Stocks That Outperformed the M...106 ViewsJames Li2023-06-21 19:36
3New Feature: DuPont Analysis Chart for Enhance...259 ViewsVera Yuan2023-06-21 16:55
4The Most-Sold Guru Stocks of the 1st Quarter261 ViewsMargaret Moran2023-06-16 17:32
5AI Revolution and Debt Ceiling Resolution198 ViewsWade W. Slome, CFA, CFP2023-06-05 21:03
6Nvidia vs. ARK Invest: Which Is the Better Gro...332 ViewsJoey Frenette2023-05-27 02:05
7Top 5 1st Quarter Trades of CYPRESS ASSET MANA...0 ViewsGuruFocus Editor2023-05-26 14:08
8Mill Creek Capital Advisors, LLC Buys 2, Sells...0 ViewsGuruFocus Editor2023-05-25 18:10
9Jim Simons' Renaissance Technologies Chops Pos...380 ViewsJames Li2023-05-24 18:43
\n", "
" ], "text/plain": [ " title view \\\n", "0 3 Magic Formula Stocks Popular With Gurus 0 Views \n", "1 Jeremy Grantham: The Super Bubble Is About to Pop 60 Views \n", "2 5 High GF Score Stocks That Outperformed the M... 106 Views \n", "3 New Feature: DuPont Analysis Chart for Enhance... 259 Views \n", "4 The Most-Sold Guru Stocks of the 1st Quarter 261 Views \n", "5 AI Revolution and Debt Ceiling Resolution 198 Views \n", "6 Nvidia vs. ARK Invest: Which Is the Better Gro... 332 Views \n", "7 Top 5 1st Quarter Trades of CYPRESS ASSET MANA... 0 Views \n", "8 Mill Creek Capital Advisors, LLC Buys 2, Sells... 0 Views \n", "9 Jim Simons' Renaissance Technologies Chops Pos... 380 Views \n", "\n", " source datetime \n", "0 Margaret Moran 2023-06-23 17:38 \n", "1 Ben Alaimo 2023-06-23 09:21 \n", "2 James Li 2023-06-21 19:36 \n", "3 Vera Yuan 2023-06-21 16:55 \n", "4 Margaret Moran 2023-06-16 17:32 \n", "5 Wade W. Slome, CFA, CFP 2023-06-05 21:03 \n", "6 Joey Frenette 2023-05-27 02:05 \n", "7 GuruFocus Editor 2023-05-26 14:08 \n", "8 GuruFocus Editor 2023-05-25 18:10 \n", "9 James Li 2023-05-24 18:43 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"view\" ,\"source\", \"datetime\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Alliance News" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.alliancenews_streaming import AllianceNews_Streaming" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "news_downloader = AllianceNews_Streaming()\n", "news_downloader.download_streaming_search(rounds = 3)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(36, 16)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.shape" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
urlIdtitlesummarycreatedupdatedthumbnailUrlsourcetaxonomiestypeauthormetasponsorparentcontentIddisplayTaxonomiesparentTaxonomy
0/news/new-york-market-close-stocks-down-dollar...NEW YORK MARKET CLOSE: Stocks down, dollar up ...None2023-06-23T21:18:342023-06-23T21:18:34None{'code': 'ALLIANCE', 'title': 'Alliance News',...[{'termId': 'CTMRR', 'parentTermId': None, 'ti...newsNone{'title': 'NEW YORK MARKET CLOSE: Stocks down,...NoneNoneal1687551514259519100[{'termId': 'TPCOM', 'parentTermId': 'PTMKT', ...None
\n", "
" ], "text/plain": [ " urlId \\\n", "0 /news/new-york-market-close-stocks-down-dollar... \n", "\n", " title summary \\\n", "0 NEW YORK MARKET CLOSE: Stocks down, dollar up ... None \n", "\n", " created updated thumbnailUrl \\\n", "0 2023-06-23T21:18:34 2023-06-23T21:18:34 None \n", "\n", " source \\\n", "0 {'code': 'ALLIANCE', 'title': 'Alliance News',... \n", "\n", " taxonomies type author \\\n", "0 [{'termId': 'CTMRR', 'parentTermId': None, 'ti... news None \n", "\n", " meta sponsor parent \\\n", "0 {'title': 'NEW YORK MARKET CLOSE: Stocks down,... None None \n", "\n", " contentId displayTaxonomies \\\n", "0 al1687551514259519100 [{'termId': 'TPCOM', 'parentTermId': 'PTMKT', ... \n", "\n", " parentTaxonomy \n", "0 None " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.head(1)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
createdupdatedtitlesummarymeta
02023-06-23T21:18:342023-06-23T21:18:34NEW YORK MARKET CLOSE: Stocks down, dollar up ...None{'title': 'NEW YORK MARKET CLOSE: Stocks down,...
12023-06-23T19:34:052023-06-23T19:34:05IN BRIEF: Blackstone Loan Financing proposes w...None{'title': 'IN BRIEF: Blackstone Loan Financing...
22023-06-23T18:34:412023-06-23T18:34:41IN BRIEF: Bonhill expects to complete sale of ...None{'title': 'IN BRIEF: Bonhill expects to comple...
32023-06-23T18:01:272023-06-23T18:01:27UPDATE: SRT Marine Systems raises GBP4.6 milli...None{'title': 'UPDATE: SRT Marine Systems raises G...
42023-06-23T18:00:272023-06-23T18:00:27IN BRIEF: New Energy One Acquisition confirms ...None{'title': 'IN BRIEF: New Energy One Acquisitio...
52023-06-23T17:41:152023-06-23T17:41:15IN BRIEF: Kropz makes draw down request on bri...None{'title': 'IN BRIEF: Kropz makes draw down req...
62023-06-23T17:31:172023-06-23T17:31:17IN BRIEF: XPS Pensions discusses National Pens...None{'title': 'IN BRIEF: XPS Pensions discusses Na...
72023-06-23T17:25:542023-06-23T17:25:54DIRECTOR DEALINGS: GSK CFO buys shares worth G...None{'title': 'DIRECTOR DEALINGS: GSK CFO buys sha...
82023-06-23T17:21:292023-06-23T17:21:29IN BRIEF: Gilead Sciences says test results sh...None{'title': 'IN BRIEF: Gilead Sciences says test...
92023-06-23T17:07:242023-06-23T17:07:24IN THE KNOW: AB Foods \"fundamentally strong\" w...None{'title': 'IN THE KNOW: AB Foods \"fundamentall...
\n", "
" ], "text/plain": [ " created updated \\\n", "0 2023-06-23T21:18:34 2023-06-23T21:18:34 \n", "1 2023-06-23T19:34:05 2023-06-23T19:34:05 \n", "2 2023-06-23T18:34:41 2023-06-23T18:34:41 \n", "3 2023-06-23T18:01:27 2023-06-23T18:01:27 \n", "4 2023-06-23T18:00:27 2023-06-23T18:00:27 \n", "5 2023-06-23T17:41:15 2023-06-23T17:41:15 \n", "6 2023-06-23T17:31:17 2023-06-23T17:31:17 \n", "7 2023-06-23T17:25:54 2023-06-23T17:25:54 \n", "8 2023-06-23T17:21:29 2023-06-23T17:21:29 \n", "9 2023-06-23T17:07:24 2023-06-23T17:07:24 \n", "\n", " title summary \\\n", "0 NEW YORK MARKET CLOSE: Stocks down, dollar up ... None \n", "1 IN BRIEF: Blackstone Loan Financing proposes w... None \n", "2 IN BRIEF: Bonhill expects to complete sale of ... None \n", "3 UPDATE: SRT Marine Systems raises GBP4.6 milli... None \n", "4 IN BRIEF: New Energy One Acquisition confirms ... None \n", "5 IN BRIEF: Kropz makes draw down request on bri... None \n", "6 IN BRIEF: XPS Pensions discusses National Pens... None \n", "7 DIRECTOR DEALINGS: GSK CFO buys shares worth G... None \n", "8 IN BRIEF: Gilead Sciences says test results sh... None \n", "9 IN THE KNOW: AB Foods \"fundamentally strong\" w... None \n", "\n", " meta \n", "0 {'title': 'NEW YORK MARKET CLOSE: Stocks down,... \n", "1 {'title': 'IN BRIEF: Blackstone Loan Financing... \n", "2 {'title': 'IN BRIEF: Bonhill expects to comple... \n", "3 {'title': 'UPDATE: SRT Marine Systems raises G... \n", "4 {'title': 'IN BRIEF: New Energy One Acquisitio... \n", "5 {'title': 'IN BRIEF: Kropz makes draw down req... \n", "6 {'title': 'IN BRIEF: XPS Pensions discusses Na... \n", "7 {'title': 'DIRECTOR DEALINGS: GSK CFO buys sha... \n", "8 {'title': 'IN BRIEF: Gilead Sciences says test... \n", "9 {'title': 'IN THE KNOW: AB Foods \"fundamentall... " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"created\", \"updated\", \"title\", \"summary\", \"meta\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Talk Market" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.talkmarkets_streaming import TalkMarkets_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading... 0 1 2 " ] } ], "source": [ "news_downloader = TalkMarkets_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(60, 12)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.shape" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
cacheUrlclicktrackUrlcontentcontentNoFormattingtitletitleNoFormattingformattedUrlunescapedUrlurlvisibleUrlrichSnippetbreadcrumbUrl
0http://www.google.com/search?q=cache:PUjyIRJA8...https://www.google.com/url?client=internal-ele...23 hours ago <b>...</b> <b>Apple</b>, 187, 3.0...23 hours ago ... Apple, 187, 3.04, 1.65%, 187....Equitymaster India | Sensex Today Trades Lower...Equitymaster India | Sensex Today Trades Lower...https://talkmarkets.com/.../sensex-today-trade...https://talkmarkets.com/content/global-markets...https://talkmarkets.com/content/global-markets...talkmarkets.com{'cseImage': {'src': 'https://www.eqimg.com/im...{'host': 'talkmarkets.com', 'crumbs': ['sensex...
\n", "
" ], "text/plain": [ " cacheUrl \\\n", "0 http://www.google.com/search?q=cache:PUjyIRJA8... \n", "\n", " clicktrackUrl \\\n", "0 https://www.google.com/url?client=internal-ele... \n", "\n", " content \\\n", "0 23 hours ago ... Apple, 187, 3.0... \n", "\n", " contentNoFormatting \\\n", "0 23 hours ago ... Apple, 187, 3.04, 1.65%, 187.... \n", "\n", " title \\\n", "0 Equitymaster India | Sensex Today Trades Lower... \n", "\n", " titleNoFormatting \\\n", "0 Equitymaster India | Sensex Today Trades Lower... \n", "\n", " formattedUrl \\\n", "0 https://talkmarkets.com/.../sensex-today-trade... \n", "\n", " unescapedUrl \\\n", "0 https://talkmarkets.com/content/global-markets... \n", "\n", " url visibleUrl \\\n", "0 https://talkmarkets.com/content/global-markets... talkmarkets.com \n", "\n", " richSnippet \\\n", "0 {'cseImage': {'src': 'https://www.eqimg.com/im... \n", "\n", " breadcrumbUrl \n", "0 {'host': 'talkmarkets.com', 'crumbs': ['sensex... " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.head(1)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
contenturlclicktrackUrl
023 hours ago <b>...</b> <b>Apple</b>, 187, 3.0...https://talkmarkets.com/content/global-markets...https://www.google.com/url?client=internal-ele...
11 day ago <b>...</b> Get Adobe Inc. (ADBE:NASD...https://talkmarkets.com/symbol/adbe/portal-wid...https://www.google.com/url?client=internal-ele...
21 day ago <b>...</b> Get Starbucks Corp (SBUX:...https://talkmarkets.com/symbol/sbux/portal-wid...https://www.google.com/url?client=internal-ele...
310 hours ago <b>...</b> Wednesday&#39;s top an...https://talkmarkets.com/symbol/pypl/portal-wid...https://www.google.com/url?client=internal-ele...
420 hours ago <b>...</b> <b>Apple</b> (AAPL). <...https://talkmarkets.com/content/stocks--equiti...https://www.google.com/url?client=internal-ele...
52 days ago <b>...</b> Friday&#39;s top analyst...https://talkmarkets.com/symbol/sofi/portal-wid...https://www.google.com/url?client=internal-ele...
62 days ago <b>...</b> Get Enphase Energy Inc (...https://talkmarkets.com/symbol/enph/portal-wid...https://www.google.com/url?client=internal-ele...
73 days ago <b>...</b> <b>Apple</b> Inc. design...https://talkmarkets.com/contributor/jimvanmeer...https://www.google.com/url?client=internal-ele...
83 days ago <b>...</b> <b>Apple</b> Inc. design...https://talkmarkets.com/content/stocks--equiti...https://www.google.com/url?client=internal-ele...
95 Jan 2023 <b>...</b> Get Amazon.com Inc (AMZN...https://talkmarkets.com/symbol/amzn/portal-wid...https://www.google.com/url?client=internal-ele...
\n", "
" ], "text/plain": [ " content \\\n", "0 23 hours ago ... Apple, 187, 3.0... \n", "1 1 day ago ... Get Adobe Inc. (ADBE:NASD... \n", "2 1 day ago ... Get Starbucks Corp (SBUX:... \n", "3 10 hours ago ... Wednesday's top an... \n", "4 20 hours ago ... Apple (AAPL). <... \n", "5 2 days ago ... Friday's top analyst... \n", "6 2 days ago ... Get Enphase Energy Inc (... \n", "7 3 days ago ... Apple Inc. design... \n", "8 3 days ago ... Apple Inc. design... \n", "9 5 Jan 2023 ... Get Amazon.com Inc (AMZN... \n", "\n", " url \\\n", "0 https://talkmarkets.com/content/global-markets... \n", "1 https://talkmarkets.com/symbol/adbe/portal-wid... \n", "2 https://talkmarkets.com/symbol/sbux/portal-wid... \n", "3 https://talkmarkets.com/symbol/pypl/portal-wid... \n", "4 https://talkmarkets.com/content/stocks--equiti... \n", "5 https://talkmarkets.com/symbol/sofi/portal-wid... \n", "6 https://talkmarkets.com/symbol/enph/portal-wid... \n", "7 https://talkmarkets.com/contributor/jimvanmeer... \n", "8 https://talkmarkets.com/content/stocks--equiti... \n", "9 https://talkmarkets.com/symbol/amzn/portal-wid... \n", "\n", " clicktrackUrl \n", "0 https://www.google.com/url?client=internal-ele... \n", "1 https://www.google.com/url?client=internal-ele... \n", "2 https://www.google.com/url?client=internal-ele... \n", "3 https://www.google.com/url?client=internal-ele... \n", "4 https://www.google.com/url?client=internal-ele... \n", "5 https://www.google.com/url?client=internal-ele... \n", "6 https://www.google.com/url?client=internal-ele... \n", "7 https://www.google.com/url?client=internal-ele... \n", "8 https://www.google.com/url?client=internal-ele... \n", "9 https://www.google.com/url?client=internal-ele... " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"content\", \"url\", \"clicktrackUrl\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### The Fly" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.thefly_streaming import TheFly_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "c:\\ProgramData\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host 'thefly.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n", " warnings.warn(\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Only support the first page now!\n" ] } ], "source": [ "news_downloader = TheFly_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"AAPL\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlestockabstractdatetime
0Apple in talks to launch Apple Card in India, ...AAPLApple is in talks to…06/23/2305:37
1Apple says visionOS software development kit n...AAPLApple announced the…06/21/2316:03
2Apple to create spatial experiences for Apple ...AAPLApple \"announced the…06/21/2316:00
3Notable open interest changes for June 21stTSLA NVDA AAPL AMZNTuesday's total…06/21/2308:55
4What You Missed This Week in Video GamesTCEHY TTWO EA CCOEY UBSFY CMCSK CMCSA RBLX AAP...\"Game On\" is The Fly's…06/20/2312:11
5Notable open interest changes for June 20thTSLA AMC AAPL NVDAFriday's total…06/20/2308:55
6Apple call buyer realizes 20% same-day gainsAAPLNotable profits for the…06/16/2308:00
7Notable open interest changes for June 15thTSLA NVDA SOFI AAPLWednesday's total…06/15/2308:55
8US senators propose bill to eliminate Section ...GOOG MSFT AMZN AAPL NVDA IBM META INTC\"U.S. Senators Josh…06/14/2317:54
9#SocialStocks: Twitter skips out on rent and G...TWTR AAPL META GOOGL GOOG ZM RBLX PINSWelcome to…06/14/2315:57
\n", "
" ], "text/plain": [ " title ... time\n", "0 Apple in talks to launch Apple Card in India, ... ... 05:37\n", "1 Apple says visionOS software development kit n... ... 16:03\n", "2 Apple to create spatial experiences for Apple ... ... 16:00\n", "3 Notable open interest changes for June 21st ... 08:55\n", "4 What You Missed This Week in Video Games ... 12:11\n", "5 Notable open interest changes for June 20th ... 08:55\n", "6 Apple call buyer realizes 20% same-day gains ... 08:00\n", "7 Notable open interest changes for June 15th ... 08:55\n", "8 US senators propose bill to eliminate Section ... ... 17:54\n", "9 #SocialStocks: Twitter skips out on rent and G... ... 15:57\n", "\n", "[10 rows x 5 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"stock\", \"abstract\", \"date\", \"time\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Tip Rank" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.tipranks_streaming import TipRanks_Streaming" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading: 0 1 2 " ] } ], "source": [ "news_downloader = TipRanks_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
stocks_idauthorcategorydatedescriptionimageisLockedlinklockTypeslugstickythumbnailtitletopicstimeAgobadgeid
0[{'ticker': 'AAPL', 'market': None}]582530{'slug': 'steveanderson'}{'slug': 'news', 'title': 'Market News'}2023-06-22T19:52:41.000Z<p>Those who regularly follow Apple stock (NAS...{'src': 'https://blog.tipranks.com/wp-content/...Truehttps://www.tipranks.com/news/aapl-notches-up-...GraceCountaapl-notches-up-following-barclays-commentsFalse{'src': 'https://blog.tipranks.com/wp-content/...AAPL Notches Up Following Barclays Comments[{'id': 0, 'type': 'stock', 'title': 'AAPL', '...13hNone582530
1[{'ticker': 'AAPL', 'market': None}, {'ticker'...579043{'slug': 'amit-singh'}{'slug': 'article', 'title': 'Stock Analysis &...2023-06-19T15:30:38.000Z<p>Affirm Holdings (NASDAQ:AFRM) stock recover...{'src': 'https://blog.tipranks.com/wp-content/...Truehttps://www.tipranks.com/news/article/affirm-s...GraceCountaffirm-stock-has-risen-swiftly-will-it-beat-ap...False{'src': 'https://blog.tipranks.com/wp-content/...Affirm Stock Has Risen Swiftly. Will It Beat A...[{'id': 0, 'type': 'stock', 'title': 'AAPL', '...4dNone579043
\n", "
" ], "text/plain": [ " stocks _id \\\n", "0 [{'ticker': 'AAPL', 'market': None}] 582530 \n", "1 [{'ticker': 'AAPL', 'market': None}, {'ticker'... 579043 \n", "\n", " author \\\n", "0 {'slug': 'steveanderson'} \n", "1 {'slug': 'amit-singh'} \n", "\n", " category \\\n", "0 {'slug': 'news', 'title': 'Market News'} \n", "1 {'slug': 'article', 'title': 'Stock Analysis &... \n", "\n", " date \\\n", "0 2023-06-22T19:52:41.000Z \n", "1 2023-06-19T15:30:38.000Z \n", "\n", " description \\\n", "0

Those who regularly follow Apple stock (NAS... \n", "1

Affirm Holdings (NASDAQ:AFRM) stock recover... \n", "\n", " image isLocked \\\n", "0 {'src': 'https://blog.tipranks.com/wp-content/... True \n", "1 {'src': 'https://blog.tipranks.com/wp-content/... True \n", "\n", " link lockType \\\n", "0 https://www.tipranks.com/news/aapl-notches-up-... GraceCount \n", "1 https://www.tipranks.com/news/article/affirm-s... GraceCount \n", "\n", " slug sticky \\\n", "0 aapl-notches-up-following-barclays-comments False \n", "1 affirm-stock-has-risen-swiftly-will-it-beat-ap... False \n", "\n", " thumbnail \\\n", "0 {'src': 'https://blog.tipranks.com/wp-content/... \n", "1 {'src': 'https://blog.tipranks.com/wp-content/... \n", "\n", " title \\\n", "0 AAPL Notches Up Following Barclays Comments \n", "1 Affirm Stock Has Risen Swiftly. Will It Beat A... \n", "\n", " topics timeAgo badge id \n", "0 [{'id': 0, 'type': 'stock', 'title': 'AAPL', '... 13h None 582530 \n", "1 [{'id': 0, 'type': 'stock', 'title': 'AAPL', '... 4d None 579043 " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "news_downloader.dataframe.head(2)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "

\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
stocksdateauthortitledescription
0[{'ticker': 'AAPL', 'market': None}]2023-06-22T19:52:41.000Z{'slug': 'steveanderson'}AAPL Notches Up Following Barclays Comments<p>Those who regularly follow Apple stock (NAS...
1[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-19T15:30:38.000Z{'slug': 'amit-singh'}Affirm Stock Has Risen Swiftly. Will It Beat A...<p>Affirm Holdings (NASDAQ:AFRM) stock recover...
2[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-16T20:51:11.000Z{'slug': 'joey-frenette'}Apple Stock (NASDAQ:AAPL): Expectations Too Mo...<p>Apple (NASDAQ:AAPL) stock recently hit a ne...
3[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-16T08:32:40.000Z{'slug': 'sheryl-sheth'}Lost the Nvidia and Apple Boom? Microsoft (NAS...<p>Think you lost the chance to become wealthy...
4[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-15T19:20:48.000Z{'slug': 'joey-frenette'}Unity Software (NASDAQ:U): Apple Vision Pro Pa...<p>Unity Software (NASDAQ:U) rallied 17% when ...
5[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-15T00:53:16.000Z{'slug': 'joey-frenette'}Investing in Apple’s (NASDAQ:AAPL) Ecosystem: ...<p>Apple (NASDAQ:AAPL) has been on an unbeliev...
6[{'ticker': 'AAPL', 'market': None}]2023-06-13T15:13:40.000Z{'slug': 'vince-condarcuri'}AAPL Stock Slips after Analyst Downgrade<p>Despite outperforming the S&amp;P 500 with ...
7[{'ticker': 'AAPL', 'market': None}]2023-06-10T15:09:23.000Z{'slug': 'martyshtrubel'}Apple Stock Gets a New Street-High Price Target<p>Apple’s (NASDAQ:AAPL) virtual reality and a...
8[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-09T09:46:28.000Z{'slug': 'amit-singh'}NVDA to META: Insiders Capitalise on Tech Stoc...<p>Technology stocks rebounded strongly in 202...
9[{'ticker': 'AAPL', 'market': None}, {'ticker'...2023-06-08T18:20:20.000Z{'slug': 'michaelbyrne'}Apple Stock is on Fire. Invest in it with Thes...<p>Apple (NASDAQ:AAPL) stock is off to a gain ...
\n", "
" ], "text/plain": [ " stocks \\\n", "0 [{'ticker': 'AAPL', 'market': None}] \n", "1 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "2 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "3 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "4 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "5 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "6 [{'ticker': 'AAPL', 'market': None}] \n", "7 [{'ticker': 'AAPL', 'market': None}] \n", "8 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "9 [{'ticker': 'AAPL', 'market': None}, {'ticker'... \n", "\n", " date author \\\n", "0 2023-06-22T19:52:41.000Z {'slug': 'steveanderson'} \n", "1 2023-06-19T15:30:38.000Z {'slug': 'amit-singh'} \n", "2 2023-06-16T20:51:11.000Z {'slug': 'joey-frenette'} \n", "3 2023-06-16T08:32:40.000Z {'slug': 'sheryl-sheth'} \n", "4 2023-06-15T19:20:48.000Z {'slug': 'joey-frenette'} \n", "5 2023-06-15T00:53:16.000Z {'slug': 'joey-frenette'} \n", "6 2023-06-13T15:13:40.000Z {'slug': 'vince-condarcuri'} \n", "7 2023-06-10T15:09:23.000Z {'slug': 'martyshtrubel'} \n", "8 2023-06-09T09:46:28.000Z {'slug': 'amit-singh'} \n", "9 2023-06-08T18:20:20.000Z {'slug': 'michaelbyrne'} \n", "\n", " title \\\n", "0 AAPL Notches Up Following Barclays Comments \n", "1 Affirm Stock Has Risen Swiftly. Will It Beat A... \n", "2 Apple Stock (NASDAQ:AAPL): Expectations Too Mo... \n", "3 Lost the Nvidia and Apple Boom? Microsoft (NAS... \n", "4 Unity Software (NASDAQ:U): Apple Vision Pro Pa... \n", "5 Investing in Apple’s (NASDAQ:AAPL) Ecosystem: ... \n", "6 AAPL Stock Slips after Analyst Downgrade \n", "7 Apple Stock Gets a New Street-High Price Target \n", "8 NVDA to META: Insiders Capitalise on Tech Stoc... \n", "9 Apple Stock is on Fire. Invest in it with Thes... \n", "\n", " description \n", "0

Those who regularly follow Apple stock (NAS... \n", "1

Affirm Holdings (NASDAQ:AFRM) stock recover... \n", "2

Apple (NASDAQ:AAPL) stock recently hit a ne... \n", "3

Think you lost the chance to become wealthy... \n", "4

Unity Software (NASDAQ:U) rallied 17% when ... \n", "5

Apple (NASDAQ:AAPL) has been on an unbeliev... \n", "6

Despite outperforming the S&P 500 with ... \n", "7

Apple’s (NASDAQ:AAPL) virtual reality and a... \n", "8

Technology stocks rebounded strongly in 202... \n", "9

Apple (NASDAQ:AAPL) stock is off to a gain ... " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"stocks\", \"date\", \"author\", \"title\", \"description\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Market Watch (Date Range)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.marketwatch_date_range import MarketWatch_Date_Range" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "start_date = \"2022-06-01\"\n", "end_date = \"2022-06-30\"\n", "keyword = \"apple\"" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Only support the first page now!\n" ] } ], "source": [ "news_downloader = MarketWatch_Date_Range()\n", "news_downloader.download_date_range_search(keyword = \"apple\", start_date = start_date, end_date = end_date)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "

\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titletimeauthor
0Gold falls more than 2% for the month, settles...Jun. 30, 2022 at 2:47 p.m. ETby Joseph Adinolfi
1AMD stock gets an upgrade as analyst says rece...Jun. 30, 2022 at 12:07 p.m. ETby Emily Bary
2All 30 Dow stocks are falling, with Goldman Sa...Jun. 30, 2022 at 9:47 a.m. ETby Tomi Kilgore
3Here’s how far oil could fall in a recession, ...Jun. 30, 2022 at 8:34 a.m. ETby Steve Goldstein
4Crypto Winter Is Coming After SEC Rejects Key ...Jun. 30, 2022 at 6:37 a.m. ET
5An FCC Commissioner Wants TikTok Yanked From A...Jun. 30, 2022 at 3:27 a.m. ETby Barron's
6Meta Has a New Problem. Profit Forecasts Now L...Jun. 29, 2022 at 1:18 p.m. ETby Barron's
7Fed rolls out new index to flag early warning ...Jun. 29, 2022 at 1:04 p.m. ETby Joy Wiltermuth
8Apple Investors Have Something New to Focus On...Jun. 29, 2022 at 12:41 p.m. ETby Barron's
9Here’s why this trader is piling back into one...Jun. 29, 2022 at 10:34 a.m. ETby Barbara Kollmeyer
\n", "
" ], "text/plain": [ " title \\\n", "0 Gold falls more than 2% for the month, settles... \n", "1 AMD stock gets an upgrade as analyst says rece... \n", "2 All 30 Dow stocks are falling, with Goldman Sa... \n", "3 Here’s how far oil could fall in a recession, ... \n", "4 Crypto Winter Is Coming After SEC Rejects Key ... \n", "5 An FCC Commissioner Wants TikTok Yanked From A... \n", "6 Meta Has a New Problem. Profit Forecasts Now L... \n", "7 Fed rolls out new index to flag early warning ... \n", "8 Apple Investors Have Something New to Focus On... \n", "9 Here’s why this trader is piling back into one... \n", "\n", " time author \n", "0 Jun. 30, 2022 at 2:47 p.m. ET by Joseph Adinolfi \n", "1 Jun. 30, 2022 at 12:07 p.m. ET by Emily Bary \n", "2 Jun. 30, 2022 at 9:47 a.m. ET by Tomi Kilgore \n", "3 Jun. 30, 2022 at 8:34 a.m. ET by Steve Goldstein \n", "4 Jun. 30, 2022 at 6:37 a.m. ET \n", "5 Jun. 30, 2022 at 3:27 a.m. ET by Barron's \n", "6 Jun. 29, 2022 at 1:18 p.m. ET by Barron's \n", "7 Jun. 29, 2022 at 1:04 p.m. ET by Joy Wiltermuth \n", "8 Jun. 29, 2022 at 12:41 p.m. ET by Barron's \n", "9 Jun. 29, 2022 at 10:34 a.m. ET by Barbara Kollmeyer " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"time\", \"author\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Market Watch (Streaming)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.marketwatch_streaming import MarketWatch_Streaming" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Only support the first page now!\n" ] } ], "source": [ "news_downloader = MarketWatch_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titletimeauthor
0Tech IPOs Should Be Heating Up. Why They’re Not.Jun. 23, 2023 at 2:51 a.m. ETby Barron's
1Everything Is Going Right for Tesla. It’s Time...Jun. 23, 2023 at 1:30 a.m. ETby Barron's
2India’s Modi cracks jokes, chows down at swank...Jun. 22, 2023 at 11:38 p.m. ETby Associated Press
3Work-From-Home Job Openings Are ShrinkingJun. 22, 2023 at 6:23 p.m. ETby Barron's
4Congress Blasts E-Commerce Firm Temu Over Forc...Jun. 22, 2023 at 5:44 p.m. ETby Barron's
5Meta Platforms Inc. stock outperforms market o...Jun. 22, 2023 at 5:32 p.m. ETby MarketWatch Automation
6Microsoft Corp. stock outperforms competitors ...Jun. 22, 2023 at 5:32 p.m. ETby MarketWatch Automation
7Netflix Inc. stock underperforms Thursday when...Jun. 22, 2023 at 5:32 p.m. ETby MarketWatch Automation
8GameStop Corp. Cl A stock underperforms Thursd...Jun. 22, 2023 at 5:29 p.m. ETby MarketWatch Automation
9Amazon.com Inc. stock outperforms market on st...Jun. 22, 2023 at 5:25 p.m. ETby MarketWatch Automation
\n", "
" ], "text/plain": [ " title \\\n", "0 Tech IPOs Should Be Heating Up. Why They’re Not. \n", "1 Everything Is Going Right for Tesla. It’s Time... \n", "2 India’s Modi cracks jokes, chows down at swank... \n", "3 Work-From-Home Job Openings Are Shrinking \n", "4 Congress Blasts E-Commerce Firm Temu Over Forc... \n", "5 Meta Platforms Inc. stock outperforms market o... \n", "6 Microsoft Corp. stock outperforms competitors ... \n", "7 Netflix Inc. stock underperforms Thursday when... \n", "8 GameStop Corp. Cl A stock underperforms Thursd... \n", "9 Amazon.com Inc. stock outperforms market on st... \n", "\n", " time author \n", "0 Jun. 23, 2023 at 2:51 a.m. ET by Barron's \n", "1 Jun. 23, 2023 at 1:30 a.m. ET by Barron's \n", "2 Jun. 22, 2023 at 11:38 p.m. ET by Associated Press \n", "3 Jun. 22, 2023 at 6:23 p.m. ET by Barron's \n", "4 Jun. 22, 2023 at 5:44 p.m. ET by Barron's \n", "5 Jun. 22, 2023 at 5:32 p.m. ET by MarketWatch Automation \n", "6 Jun. 22, 2023 at 5:32 p.m. ET by MarketWatch Automation \n", "7 Jun. 22, 2023 at 5:32 p.m. ET by MarketWatch Automation \n", "8 Jun. 22, 2023 at 5:29 p.m. ET by MarketWatch Automation \n", "9 Jun. 22, 2023 at 5:25 p.m. ET by MarketWatch Automation " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"time\", \"author\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Penny Stock" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.pennystocks_streaming import PennyStocks_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requesting https://pennystocks.com ... succeed!\n", "Gathering again .. Remaining Retry: 4\n", "Only support the first page now!\n" ] } ], "source": [ "news_downloader = PennyStocks_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titletimebriefreading_time
0Best Penny Stocks to Buy Ahead Of Apple’s Even...September 14, 2021\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWhat do penny stock in...5 minute read
0What Could The Apple Event Mean For Penny Stoc...October 13, 2020\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWill The Apple Event M...5 minute read
03 Red Hot Penny Stocks To Watch Before Next We...June 14, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tPenny stocks to watch.\\n4 minute read
0Penny Stocks Definition & 7 Trading Strategies...June 8, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWhat Is A Penny Stock?...6 minute read
0Best Penny Stocks To Buy? 5 With Big News This...June 7, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tPenny stocks to watch ...4 minute read
0Penny Stocks & The Stock Market Today: Top Tre...May 30, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWhat happened in the s...6 minute read
0Penny Stocks To Buy? 3 AI Stocks To Watch Righ...May 30, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tAI penny stocks to wat...5 minute read
0What Are Penny Stocks & Should You Buy Them In...May 19, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tShould You Find Penny ...6 minute read
0Trading Penny Stocks: 3 High-Growth Industries...May 8, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWatch these three indu...7 minute read
0Fed Meeting Live Updates: 10 Takeaways From Ma...May 3, 2023\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tFOMC Statement From Ma...10 minute read
\n", "
" ], "text/plain": [ " title time \\\n", "0 Best Penny Stocks to Buy Ahead Of Apple’s Even... September 14, 2021 \n", "0 What Could The Apple Event Mean For Penny Stoc... October 13, 2020 \n", "0 3 Red Hot Penny Stocks To Watch Before Next We... June 14, 2023 \n", "0 Penny Stocks Definition & 7 Trading Strategies... June 8, 2023 \n", "0 Best Penny Stocks To Buy? 5 With Big News This... June 7, 2023 \n", "0 Penny Stocks & The Stock Market Today: Top Tre... May 30, 2023 \n", "0 Penny Stocks To Buy? 3 AI Stocks To Watch Righ... May 30, 2023 \n", "0 What Are Penny Stocks & Should You Buy Them In... May 19, 2023 \n", "0 Trading Penny Stocks: 3 High-Growth Industries... May 8, 2023 \n", "0 Fed Meeting Live Updates: 10 Takeaways From Ma... May 3, 2023 \n", "\n", " brief reading_time \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWhat do penny stock in... 5 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWill The Apple Event M... 5 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tPenny stocks to watch.\\n 4 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWhat Is A Penny Stock?... 6 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tPenny stocks to watch ... 4 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWhat happened in the s... 6 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tAI penny stocks to wat... 5 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tShould You Find Penny ... 6 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tWatch these three indu... 7 minute read \n", "0 \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tFOMC Statement From Ma... 10 minute read " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"time\", \"brief\", \"reading_time\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Seeking Alpha" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.seekingalpha_date_range import SeekingAlpha_Date_Range" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "start_date = \"2023-06-01\"\n", "end_date = \"2023-06-30\"\n", "stock = \"AAPL\"" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Downloading Titles: 100%|██████████| 1/1 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
publishOntitlecommentCount
02023-06-19T09:00:00-04:00Artificial intelligence is a '1995 moment' for...63
12023-06-16T11:59:46-04:00Citi: Don't worry about Big Tech fueling 2023'...17
22023-06-15T07:20:12-04:00Google said to temper chatbot use for employee...8
32023-06-14T05:17:31-04:00Nvidia crosses $1T market cap powered by the r...36
42023-06-13T17:17:00-04:00Intel in talks to be anchor investor in chip d...94
52023-06-13T12:14:45-04:00Hot Stocks: AAPL falls on downgrade; MANU rise...3
62023-06-13T06:22:59-04:00Apple notches record close as bulls continue t...18
72023-06-13T04:49:26-04:00Apple cut to Neutral at UBS on softer iPhone a...26
82023-06-09T05:42:17-04:00AI looking like a 'winner-take-more' game - Go...39
92023-06-09T05:21:04-04:00Zuckerberg's vision for AR/VR headsets differe...92
\n", "" ], "text/plain": [ " publishOn \\\n", "0 2023-06-19T09:00:00-04:00 \n", "1 2023-06-16T11:59:46-04:00 \n", "2 2023-06-15T07:20:12-04:00 \n", "3 2023-06-14T05:17:31-04:00 \n", "4 2023-06-13T17:17:00-04:00 \n", "5 2023-06-13T12:14:45-04:00 \n", "6 2023-06-13T06:22:59-04:00 \n", "7 2023-06-13T04:49:26-04:00 \n", "8 2023-06-09T05:42:17-04:00 \n", "9 2023-06-09T05:21:04-04:00 \n", "\n", " title commentCount \n", "0 Artificial intelligence is a '1995 moment' for... 63 \n", "1 Citi: Don't worry about Big Tech fueling 2023'... 17 \n", "2 Google said to temper chatbot use for employee... 8 \n", "3 Nvidia crosses $1T market cap powered by the r... 36 \n", "4 Intel in talks to be anchor investor in chip d... 94 \n", "5 Hot Stocks: AAPL falls on downgrade; MANU rise... 3 \n", "6 Apple notches record close as bulls continue t... 18 \n", "7 Apple cut to Neutral at UBS on softer iPhone a... 26 \n", "8 AI looking like a 'winner-take-more' game - Go... 39 \n", "9 Zuckerberg's vision for AR/VR headsets differe... 92 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"publishOn\",\"title\",\"commentCount\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Reuters" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.reuters_streaming import Reuters_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Geting pages: 1 2 3 " ] } ], "source": [ "news_downloader = Reuters_Streaming()\n", "news_downloader.download_streaming_search(keyword = \"apple\", rounds = 3)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
published_timetitledescription
02023-06-19T10:17:24.474ZHong Kong tycoon Jimmy Lai loses appeal agains...A Hong Kong appeal court on Monday blocked jai...
12023-06-19T09:49:09.391ZPodcast: Blinken meets Xi and Chinese bankers ...U.S. Secretary of State Anthony Blinken is in ...
22023-06-19T02:10:24.581ZTheir parents made China the world's factory. ...When Steven Du took over his parents' factory ...
32023-06-17T08:14:15.708ZJapan to open up Apple- and Google-dominated p...Japan plans to stoke competition in smartphone...
42023-06-16T13:28:02.538ZKhashoggi's widow sues Israeli spyware company...The widow of murdered Saudi journalist Jamal K...
52023-06-16T11:12:02.899ZFactbox: DLE companies racing to reshape globa...Lithium, the metal used to make electric vehic...
62023-06-16T10:17:23.831ZPodcast: US-Iran talks and Australia divided o...Australia is divided on a historic referendum ...
72023-06-16T02:16:44.523ZChinese e-commerce giants entice cautious cons...China's e-commerce platforms are competing fie...
82023-06-15T10:21:02.697ZS&P 500 leaps to highest close in 14 months; t...The S&P 500 and Nasdaq surged on Thursday to c...
92023-06-15T19:49:27.459ZMicrosoft notches record high valuation of nea...Microsoft Corp shares rose to a new record hig...
\n", "
" ], "text/plain": [ " published_time \\\n", "0 2023-06-19T10:17:24.474Z \n", "1 2023-06-19T09:49:09.391Z \n", "2 2023-06-19T02:10:24.581Z \n", "3 2023-06-17T08:14:15.708Z \n", "4 2023-06-16T13:28:02.538Z \n", "5 2023-06-16T11:12:02.899Z \n", "6 2023-06-16T10:17:23.831Z \n", "7 2023-06-16T02:16:44.523Z \n", "8 2023-06-15T10:21:02.697Z \n", "9 2023-06-15T19:49:27.459Z \n", "\n", " title \\\n", "0 Hong Kong tycoon Jimmy Lai loses appeal agains... \n", "1 Podcast: Blinken meets Xi and Chinese bankers ... \n", "2 Their parents made China the world's factory. ... \n", "3 Japan to open up Apple- and Google-dominated p... \n", "4 Khashoggi's widow sues Israeli spyware company... \n", "5 Factbox: DLE companies racing to reshape globa... \n", "6 Podcast: US-Iran talks and Australia divided o... \n", "7 Chinese e-commerce giants entice cautious cons... \n", "8 S&P 500 leaps to highest close in 14 months; t... \n", "9 Microsoft notches record high valuation of nea... \n", "\n", " description \n", "0 A Hong Kong appeal court on Monday blocked jai... \n", "1 U.S. Secretary of State Anthony Blinken is in ... \n", "2 When Steven Du took over his parents' factory ... \n", "3 Japan plans to stoke competition in smartphone... \n", "4 The widow of murdered Saudi journalist Jamal K... \n", "5 Lithium, the metal used to make electric vehic... \n", "6 Australia is divided on a historic referendum ... \n", "7 China's e-commerce platforms are competing fie... \n", "8 The S&P 500 and Nasdaq surged on Thursday to c... \n", "9 Microsoft Corp shares rose to a new record hig... " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"published_time\",\"title\",\"description\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Sina Finance" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.sina_finance_date_range import Sina_Finance_Date_Range" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "start_date = \"2016-01-01\"\n", "end_date = \"2016-01-01\"\n", "config = {\n", " \"use_proxy\": \"china_free\",\n", " \"max_retry\": 5,\n", " \"proxy_pages\": 5,\n", "}" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Gathering free ips by pages...: 100%|██████████| 5/5 [00:04<00:00, 1.05it/s]\n", "Checking ips: 100%|██████████| 75/75 [00:20<00:00, 3.67it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "获取到的代理ip数量: 75 。Get proxy ips: 75.\n", "能用的代理数量: 75。Usable proxy ips: 75.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Downloading Titles...: 100%|██████████| 1/1 [00:01<00:00, 1.54s/it]\n", "Gathering news contents: 100%|██████████| 103/103 [00:22<00:00, 4.50it/s]\n" ] } ], "source": [ "news_downloader = Sina_Finance_Date_Range(config)\n", "news_downloader.download_date_range_all(start_date,end_date)\n", "news_downloader.gather_content()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlecontent
0分析师:伊朗重回国际原油市场无法阻止新浪美股讯 北京时间1月1日晚CNBC称,加拿大皇家银行(RBC)分析师Helima Cro...
1FAA:波音767的逃生扶梯存在缺陷新浪美股讯 北京时间1日晚,美国联邦航空局(FAA)要求航空公司对波音767机型的救生扶梯进...
2非制造业新订单指数创新高 需求回升力度明显中新社北京1月1日电 (记者 刘长忠)记者1日从中国物流与采购联合会获悉,在最新发布的201...
3雷曼兄弟针对大和证券提起索赔诉讼新浪美股讯 北京时间1日下午共同社称,2008年破产的美国金融巨头雷曼兄弟公司的清算法人日前...
4国内钢铁PMI有所回升 钢市低迷形势有所改善新华社上海1月1日专电(记者李荣)据中物联钢铁物流专业委员会1日发布的指数报告,2015年1...
5马息岭凸显朝鲜旅游体育战略新浪美股北京时间1日讯 三位单板滑雪手将成为最早拜访马息岭滑雪场的西方专业运动员,他们本月就...
6五洲船舶破产清算 近十年来首现国有船厂倒闭(原标题:中国首家国有船厂破产倒闭)\\n低迷的中国造船市场,多年来首次出现国有船厂破产清算的...
7过半城市房价环比上涨 百城住宅均价加速升温资料图。中新社记者 武俊杰 摄\\n中新社北京1月1日电 (记者 庞无忌)中国房地产市场在20...
8经济学人:巴西病根到底在哪里新浪美股北京时间1日讯 原本,巴西人是该高高兴兴迎接2016年的。8月间,里约热内卢将举办南...
9中国首家国有船厂破产倒闭:五洲船舶目前已停工低迷的中国造船市场,多年来首次出现国有船厂破产清算的一幕。浙江海运集团旗下的五洲船舶修造公司...
\n", "
" ], "text/plain": [ " title content\n", "0 分析师:伊朗重回国际原油市场无法阻止 新浪美股讯 北京时间1月1日晚CNBC称,加拿大皇家银行(RBC)分析师Helima Cro...\n", "1 FAA:波音767的逃生扶梯存在缺陷 新浪美股讯 北京时间1日晚,美国联邦航空局(FAA)要求航空公司对波音767机型的救生扶梯进...\n", "2 非制造业新订单指数创新高 需求回升力度明显 中新社北京1月1日电 (记者 刘长忠)记者1日从中国物流与采购联合会获悉,在最新发布的201...\n", "3 雷曼兄弟针对大和证券提起索赔诉讼 新浪美股讯 北京时间1日下午共同社称,2008年破产的美国金融巨头雷曼兄弟公司的清算法人日前...\n", "4 国内钢铁PMI有所回升 钢市低迷形势有所改善 新华社上海1月1日专电(记者李荣)据中物联钢铁物流专业委员会1日发布的指数报告,2015年1...\n", "5 马息岭凸显朝鲜旅游体育战略 新浪美股北京时间1日讯 三位单板滑雪手将成为最早拜访马息岭滑雪场的西方专业运动员,他们本月就...\n", "6 五洲船舶破产清算 近十年来首现国有船厂倒闭 (原标题:中国首家国有船厂破产倒闭)\\n低迷的中国造船市场,多年来首次出现国有船厂破产清算的...\n", "7 过半城市房价环比上涨 百城住宅均价加速升温 资料图。中新社记者 武俊杰 摄\\n中新社北京1月1日电 (记者 庞无忌)中国房地产市场在20...\n", "8 经济学人:巴西病根到底在哪里 新浪美股北京时间1日讯 原本,巴西人是该高高兴兴迎接2016年的。8月间,里约热内卢将举办南...\n", "9 中国首家国有船厂破产倒闭:五洲船舶目前已停工 低迷的中国造船市场,多年来首次出现国有船厂破产清算的一幕。浙江海运集团旗下的五洲船舶修造公司..." ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"content\"]\n", "news_downloader.dataframe[selected_columns].head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Eastmoney" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.eastmoney_streaming import Eastmoney_Streaming" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "pages = 3\n", "stock = \"600519\"\n", "config = {\n", " \"use_proxy\": \"china_free\",\n", " \"max_retry\": 5,\n", " \"proxy_pages\": 5,\n", "}" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Gathering free ips by pages...: 100%|██████████| 5/5 [00:04<00:00, 1.08it/s]\n", "Checking ips: 100%|██████████| 75/75 [00:20<00:00, 3.62it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "获取到的代理ip数量: 75 。Get proxy ips: 75.\n", "能用的代理数量: 75。Usable proxy ips: 75.\n", "Geting pages: 0 1 2 Get total 3 pages.\n" ] } ], "source": [ "news_downloader = Eastmoney_Streaming(config)\n", "news_downloader.download_streaming_stock(stock,pages)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
read amountcommentstitlecontent linkauthorcreate time
014076茅台2022年报的12个小秘密/news,600519,1295554981.html贵州茅台资讯04-09 19:40
12340东北证券维持贵州茅台买入评级 预计2023年净利润同比/news,600519,1295512910.html公司研报提示04-09 11:24
23850贵州茅台:融资余额169.34亿元,创近一年新低(04-07/news,600519,1295407809.html贵州茅台资讯04-08 07:30
32330贵州茅台:融资净买入1248.48万元,融资余额169.79亿/news,600519,1294929438.html贵州茅台资讯04-07 07:28
4280416贵州茅台公益基金会正式成立/news,600519,1294612056.html贵州茅台资讯04-06 12:29
53330贵州茅台04月04日获沪股通增持19.55万股/news,600519,1294268016.html贵州茅台资讯04-05 07:48
63120贵州茅台:融资余额169.66亿元,创近一年新低(04-04/news,600519,1294265710.html贵州茅台资讯04-05 07:30
722721164月4日北向资金最新动向(附十大成交股)/news,600519,1294192188.html贵州茅台资讯04-04 18:48
86541大宗交易:贵州茅台成交235.9万元,成交价1814.59元(/news,600519,1294173281.html贵州茅台资讯04-04 17:21
92330第一上海证券维持贵州茅台买入评级 目标价2428.8元/news,600519,1293784734.html公司研报提示04-04 09:30
\n", "
" ], "text/plain": [ " read amount comments title \\\n", "0 1407 6 茅台2022年报的12个小秘密 \n", "1 234 0 东北证券维持贵州茅台买入评级 预计2023年净利润同比 \n", "2 385 0 贵州茅台:融资余额169.34亿元,创近一年新低(04-07 \n", "3 233 0 贵州茅台:融资净买入1248.48万元,融资余额169.79亿 \n", "4 2804 16 贵州茅台公益基金会正式成立 \n", "5 333 0 贵州茅台04月04日获沪股通增持19.55万股 \n", "6 312 0 贵州茅台:融资余额169.66亿元,创近一年新低(04-04 \n", "7 22721 16 4月4日北向资金最新动向(附十大成交股) \n", "8 654 1 大宗交易:贵州茅台成交235.9万元,成交价1814.59元( \n", "9 233 0 第一上海证券维持贵州茅台买入评级 目标价2428.8元 \n", "\n", " content link author create time \n", "0 /news,600519,1295554981.html 贵州茅台资讯 04-09 19:40 \n", "1 /news,600519,1295512910.html 公司研报提示 04-09 11:24 \n", "2 /news,600519,1295407809.html 贵州茅台资讯 04-08 07:30 \n", "3 /news,600519,1294929438.html 贵州茅台资讯 04-07 07:28 \n", "4 /news,600519,1294612056.html 贵州茅台资讯 04-06 12:29 \n", "5 /news,600519,1294268016.html 贵州茅台资讯 04-05 07:48 \n", "6 /news,600519,1294265710.html 贵州茅台资讯 04-05 07:30 \n", "7 /news,600519,1294192188.html 贵州茅台资讯 04-04 18:48 \n", "8 /news,600519,1294173281.html 贵州茅台资讯 04-04 17:21 \n", "9 /news,600519,1293784734.html 公司研报提示 04-04 09:30 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"title\", \"create time\"]\n", "news_downloader[selected_columns].dataframe.head(10)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Finnhub / Yahoo" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.news.finnhub_date_range import Finnhub_Date_Range" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "start_date = \"2023-01-01\"\n", "end_date = \"2023-01-03\"\n", "config = {\n", " \"use_proxy\": \"us_free\",\n", " \"max_retry\": 5,\n", " \"proxy_pages\": 5,\n", " \"token\": \"YOUR_FINNHUB_TOKEN\" # Avaliable at https://finnhub.io/dashboard\n", "}" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Checking ips: 100%|██████████| 75/75 [02:51<00:00, 2.28s/it]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Get proxy ips: 75.\n", "Usable proxy ips: 75.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Downloading Titles: 100%|██████████| 1/1 [00:02<00:00, 2.66s/it]\n", "Gathering news contents: 48%|████▊ | 49/102 [03:18<02:51, 3.24s/it]c:\\Users\\Olive\\.conda\\envs\\finrl\\lib\\site-packages\\urllib3\\connectionpool.py:1052: InsecureRequestWarning: Unverified HTTPS request is being made to host 'thefly.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings\n", " InsecureRequestWarning,\n", "Gathering news contents: 100%|██████████| 102/102 [06:15<00:00, 3.68s/it]\n" ] } ], "source": [ "news_downloader = Finnhub_Date_Range(config)\n", "news_downloader.download_date_range_stock(start_date,end_date)\n", "news_downloader.gather_content()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
categorydatetimeheadlineidimagerelatedsourcesummaryurlcontent
0company2023-01-03 23:40:08My 26-Stock $349k Portfolio Gets A Nice Petrob...118107004https://media.gettyimages.com/id/1441204186/ph...AAPLSeekingAlphaMy portfolio, built specifically for my retire...https://finnhub.io/api/news?id=d3c15f6f365663b...Home\\nInvesting Strategy\\nPortfolio Strategy\\n...
1company2023-01-03 22:09:00Apple’s Market Cap Slides Below $2 Trillion fo...118105849AAPLYahooThe tech giant is one of only five U.S. compan...https://finnhub.io/api/news?id=42343678a7474e1...Error
\n", "
" ], "text/plain": [ " category datetime \\\n", "0 company 2023-01-03 23:40:08 \n", "1 company 2023-01-03 22:09:00 \n", "\n", " headline id \\\n", "0 My 26-Stock $349k Portfolio Gets A Nice Petrob... 118107004 \n", "1 Apple’s Market Cap Slides Below $2 Trillion fo... 118105849 \n", "\n", " image related source \\\n", "0 https://media.gettyimages.com/id/1441204186/ph... AAPL SeekingAlpha \n", "1 AAPL Yahoo \n", "\n", " summary \\\n", "0 My portfolio, built specifically for my retire... \n", "1 The tech giant is one of only five U.S. compan... \n", "\n", " url \\\n", "0 https://finnhub.io/api/news?id=d3c15f6f365663b... \n", "1 https://finnhub.io/api/news?id=42343678a7474e1... \n", "\n", " content \n", "0 Home\\nInvesting Strategy\\nPortfolio Strategy\\n... \n", "1 Error " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = news_downloader.dataframe\n", "df.head(2)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
headlinecontent
0My 26-Stock $349k Portfolio Gets A Nice Petrob...Home\\nInvesting Strategy\\nPortfolio Strategy\\n...
1Apple’s Market Cap Slides Below $2 Trillion fo...Error
2US STOCKS-Wall St starts the year with a dip; ...(For a Reuters live blog on U.S., UK and Europ...
3Buy 4 January Dogs Of The Dow, Watch 4 MoreHome\\nDividends\\nDividend Quick Picks\\nBuy 4 J...
4Apple's stock market value falls below $2 tril...Jan 3 (Reuters) - Apple Inc's \\n(AAPL.O)\\n sto...
5CORRECTED-UPDATE 1-Apple's stock market value ...Jan 3 (Reuters) - Apple Inc's \\n(AAPL.O)\\n sto...
6Apple Stock Falls Amid Report Of Product Order...Apple stock got off to a slow start in 2023 as...
7US STOCKS-Wall St starts the year with a dip; ...Summary\\nCompanies\\nTesla shares plunge on Q4 ...
8More than $1 trillion wiped off value of Apple...apple store\\nMore than $1 trillion has been wi...
9McLean's Iridium inks agreement to put its sat...The company hasn't named its partner, but it's...
\n", "
" ], "text/plain": [ " headline \\\n", "0 My 26-Stock $349k Portfolio Gets A Nice Petrob... \n", "1 Apple’s Market Cap Slides Below $2 Trillion fo... \n", "2 US STOCKS-Wall St starts the year with a dip; ... \n", "3 Buy 4 January Dogs Of The Dow, Watch 4 More \n", "4 Apple's stock market value falls below $2 tril... \n", "5 CORRECTED-UPDATE 1-Apple's stock market value ... \n", "6 Apple Stock Falls Amid Report Of Product Order... \n", "7 US STOCKS-Wall St starts the year with a dip; ... \n", "8 More than $1 trillion wiped off value of Apple... \n", "9 McLean's Iridium inks agreement to put its sat... \n", "\n", " content \n", "0 Home\\nInvesting Strategy\\nPortfolio Strategy\\n... \n", "1 Error \n", "2 (For a Reuters live blog on U.S., UK and Europ... \n", "3 Home\\nDividends\\nDividend Quick Picks\\nBuy 4 J... \n", "4 Jan 3 (Reuters) - Apple Inc's \\n(AAPL.O)\\n sto... \n", "5 Jan 3 (Reuters) - Apple Inc's \\n(AAPL.O)\\n sto... \n", "6 Apple stock got off to a slow start in 2023 as... \n", "7 Summary\\nCompanies\\nTesla shares plunge on Q4 ... \n", "8 apple store\\nMore than $1 trillion has been wi... \n", "9 The company hasn't named its partner, but it's... " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_columns = [\"headline\", \"content\"]\n", "df[selected_columns].head(10)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "finrl", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.12" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }