News
In [1]:
Copied!
import sys
sys.path.append("../../FinNLP")
import sys
sys.path.append("../../FinNLP")
CNBS¶
In [2]:
Copied!
from finnlp.data_sources.news.cnbc_streaming import CNBC_Streaming
from finnlp.data_sources.news.cnbc_streaming import CNBC_Streaming
In [3]:
Copied!
news_downloader = CNBC_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = CNBC_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Downloading ... 0 1 2
In [4]:
Copied!
news_downloader.dataframe.shape
news_downloader.dataframe.shape
Out[4]:
(30, 30)
In [7]:
Copied!
news_downloader.dataframe.columns
news_downloader.dataframe.columns
Out[7]:
Index(['description', 'cn:lastPubDate', 'dateModified', 'cn:dateline', 'cn:branding', 'section', 'cn:type', 'author', 'cn:source', 'cn:subtype', 'duration', 'summary', 'expires', 'cn:sectionSubType', 'cn:contentClassification', 'pubdateunix', '_id', 'url', '@id', 'datePublished', 'cn:promoImage', 'cn:title', 'cn:keyword', 'cn:liveURL', '_pubDate', '_type', '_index', 'brand', 'hint', 'hint_detail'], dtype='object')
In [5]:
Copied!
news_downloader.dataframe.head(2)
news_downloader.dataframe.head(2)
Out[5]:
description | cn:lastPubDate | dateModified | cn:dateline | cn:branding | section | cn:type | author | cn:source | cn:subtype | ... | cn:promoImage | cn:title | cn:keyword | cn:liveURL | _pubDate | _type | _index | brand | hint | hint_detail | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | While Leah Ellis was earning her doctorate at ... | 2023-06-24T10:00:01+0000 | 2023-06-24T10:00:01+0000 | cnbc | Clean Tech | cnbcnewsstory | Catherine 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 PM | 0 | 0 | cnbc | NaN | NaN | |||
1 | Amazon.com said on Friday it will take its inv... | 2023-06-24T04:50:41+0000 | 2023-06-24T04:50:41+0000 | cnbc | Technology | wirestory | [] | ... | 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 PM | 0 | 1 | cnbc | NaN | NaN |
2 rows × 30 columns
In [13]:
Copied!
selected_columns = ["datePublished", "cn:lastPubDate", "dateModified", "description", "section" ,"author", "summary" , "cn:title", "cn:type"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["datePublished", "cn:lastPubDate", "dateModified", "description", "section" ,"author", "summary" , "cn:title", "cn:type"]
news_downloader.dataframe[selected_columns].head(10)
Out[13]:
datePublished | cn:lastPubDate | dateModified | description | section | author | summary | cn:title | cn:type | |
---|---|---|---|---|---|---|---|---|---|
0 | 2023-06-24T14:00:01+0000 | 2023-06-24T10:00:01+0000 | 2023-06-24T10:00:01+0000 | While Leah Ellis was earning her doctorate at ... | Clean Tech | Catherine Clifford | Sublime Systems is scaling up a green cement. ... | Meet the 33-year-old Canadian chemist and the ... | cnbcnewsstory |
1 | 2023-06-24T05:49:10+0000 | 2023-06-24T04:50:41+0000 | 2023-06-24T04:50:41+0000 | Amazon.com said on Friday it will take its inv... | Technology | Modi and Jassy spoke about supporting Indian s... | Amazon raises investment in India to $26 billi... | wirestory | |
2 | 2023-06-23T22:12:07+0000 | 2023-06-23T18:29:45+0000 | 2023-06-23T18:29:45+0000 | As Microsoft attempts to convince regulators t... | Technology | Jordan Novet | Microsoft has been eager to grow in mobile gam... | Microsoft says it looked at acquiring Zynga bu... | cnbcnewsstory |
3 | 2023-06-23T21:51:15+0000 | 2023-06-23T17:51:15+0000 | 2023-06-23T17:51:15+0000 | The CEOs of Apple, Alphabet, Microsoft got a h... | Technology | Seema Mody | Top tech execs met with Indian Prime Minister ... | Apple's Tim Cook calls India 'huge opportunity... | cnbcnewsstory |
4 | 2023-06-23T17:32:48+0000 | 2023-06-23T13:36:59+0000 | 2023-06-23T13:36:59+0000 | Tech executives like Apple CEO Tim Cook visit ... | Fast Money Halftime Report | Seema Mody | Tech executives like Apple CEO Tim Cook visit ... | Tech CEOs meet President Biden and Indian PM M... | cnbcvideo |
5 | 2023-06-23T12:30:17+0000 | 2023-06-23T13:32:42+0000 | 2023-06-23T13:32:42+0000 | Anyone want to buy or sell this tech rally? To... | Pro: Pro Columnists | Bob Pisani | Following the rebalancing of S&P indexes last ... | Friday could offer a once-in-a-year chance to ... | cnbcnewsstory |
6 | 2023-06-23T12:26:42+0000 | 2023-06-23T11:47:06+0000 | 2023-06-23T11:47:06+0000 | Here are Friday's biggest calls on Wall Street... | Pro: Analyst Stock Picks | Michael Bloom | Here are Friday's biggest calls on Wall Street. | Here are Friday's biggest analyst calls: Meta,... | cnbcnewsstory |
7 | 2023-06-23T06:30:01+0000 | 2023-06-23T02:30:01+0000 | 2023-06-23T02:30:01+0000 | This report is from today's CNBC Daily Open, o... | Daily Open | Yeo Boon Ping | Investors have been lulled by a sense of secur... | CNBC Daily Open: Seeking shelter in tech | cnbcnewsstory |
8 | 2023-06-23T05:45:33+0000 | 2023-06-23T10:37:42+0000 | 2023-06-23T10:37:42+0000 | AMSTERDAM — Artificial intelligence has a raci... | Technology | Ryan Browne | When it comes to banking and financial service... | A.I. has a discrimination problem. In banking,... | cnbcnewsstory |
9 | 2023-06-22T23:43:01+0000 | 2023-06-23T01:01:10+0000 | 2023-06-23T01:01:10+0000 | This report is from today's CNBC Daily Open, o... | Daily Open | Yeo Boon Ping | Investors have been lulled by a sense of secur... | CNBC Daily Open: Rate hikes and red lights | cnbcnewsstory |
Yicai / 第一财经¶
In [2]:
Copied!
from finnlp.data_sources.news.yicai_streaming import Yicai_Streaming
from finnlp.data_sources.news.yicai_streaming import Yicai_Streaming
In [3]:
Copied!
news_downloader = Yicai_Streaming()
news_downloader.download_streaming_search(keyword = "茅台", rounds = 3)
news_downloader = Yicai_Streaming()
news_downloader.download_streaming_search(keyword = "茅台", rounds = 3)
Downloading ... 0 1 2
In [4]:
Copied!
news_downloader.dataframe.shape
news_downloader.dataframe.shape
Out[4]:
(60, 13)
In [6]:
Copied!
news_downloader.dataframe.head(2)
news_downloader.dataframe.head(2)
Out[6]:
author | channelid | creationDate | desc | id | previewImage | source | tags | title | topics | typeo | url | weight | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 100000320 | 06-21 11:41 | 101788593 | 第一财经 | 北斗星通;游资;龙虎;买入;通信 | 机构抄底超讯通信 游资封板北斗星通丨龙虎榜 | 10 | /news/101788593.html | 50 | ||||
1 | [周艾琳] | 53 | 06-20 21:55 | 2003年7月,第一家QFII瑞银宣布买入宝钢股份 、上港集箱等4只蓝筹公司股票,受到了国内... | 101788183 | 2023/06/e42c4bda8cc367f523764c90447ab5a3.jpg | 第一财经 | 外资;A股;基金;QFII;RQFII;瑞银 | QFII投资A股走过20年,外资驶向何方? | 10 | /news/101788183.html | 50 |
In [7]:
Copied!
selected_columns = ["author", "creationDate", "desc" ,"source", "title"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["author", "creationDate", "desc" ,"source", "title"]
news_downloader.dataframe[selected_columns].head(10)
Out[7]:
author | creationDate | desc | source | title | |
---|---|---|---|---|---|
0 | 06-21 11:41 | 第一财经 | 机构抄底超讯通信 游资封板北斗星通丨龙虎榜 | ||
1 | [周艾琳] | 06-20 21:55 | 2003年7月,第一家QFII瑞银宣布买入宝钢股份 、上港集箱等4只蓝筹公司股票,受到了国内... | 第一财经 | QFII投资A股走过20年,外资驶向何方? |
2 | 06-20 11:46 | 第一财经 | 北向资金抄底贵州<i>茅台</i> 游资联手封板中远海科丨龙虎榜 | ||
3 | 06-20 11:45 | 第一财经 | 22股获北向资金加仓超亿元 | ||
4 | 06-20 11:36 | 第一财经 | 北向资金抄底贵州<i>茅台</i> 游资联手封板中远海科丨龙虎榜 | ||
5 | 06-20 06:23 | 第一财经每日早间精选热点新闻,点击「听新闻」,一键收听。 | 第一财经 | 布林肯结束访华,外交部美大司司长介绍情况;2023高考网上咨询周时间安排公布丨早报 | |
6 | [第一财经] | 06-19 19:06 | 今日股市0619丨50大跌小票指数强势 分化局面会否延续? | ||
7 | 06-19 19:05 | 第一财经 | 今日股市0619丨50大跌小票指数强势 分化局面会否延续? | ||
8 | [一财资讯] | 06-19 17:46 | 净买入额居前三的是贵州<i>茅台</i>、药明康德、新易盛,分别获净买入3.48亿元、3.3... | 第一财经 | 北向资金净卖出14.47亿元,贵州<i>茅台</i>、药明康德等获加仓 |
9 | 06-19 15:39 | 第一财经 | 三大指数小幅收跌 TMT赛道持续大涨|尾市盘点 |
Investor Place¶
In [2]:
Copied!
from finnlp.data_sources.news.investorplace_streaming import InvestorPlace_Streaming
from finnlp.data_sources.news.investorplace_streaming import InvestorPlace_Streaming
In [3]:
Copied!
news_downloader = InvestorPlace_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = InvestorPlace_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Downloading ... 0 1 2
In [6]:
Copied!
selected_columns = ["title", "time" ,"author", "summary"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "time" ,"author", "summary"]
news_downloader.dataframe[selected_columns].head(10)
Out[6]:
title | time | author | summary | |
---|---|---|---|---|
0 | [Trillion-Dollar Tech: 3 Stocks Poised for Unp... | Jun 19, 2023 | Faisal Humayun, InvestorPlace Contributor | These are the tech stocks to buy for multibagg... |
1 | [Trillion-Dollar Tech: 3 Stocks Poised for Unp... | Jun 22, 2023 | Chris MacDonald, InvestorPlace Contributor | Warren Buffett is undoubtedly one of the great... |
2 | [Invest Like a Billionaire: 3 Long-Term Stocks... | Jun 18, 2023 | Joel Baglole, InvestorPlace Contributor | With markets now recovering from the downturn ... |
3 | [Invest Like a Billionaire: 3 Long-Term Stocks... | Jun 16, 2023 | Louis 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, 2023 | Will Ashworth, InvestorPlace Contributor | Avoiding bad stocks requires investors to get ... |
5 | [3 Tech Titans Leading the Charge Toward $10 T... | Jun 19, 2023 | Tyrik Torres, InvestorPlace Contributor | While AI software companies tend to get more b... |
6 | [7 Tech Stocks to Watch Out For in 2023 … and ... | Jun 16, 2023 | Chris MacDonald, InvestorPlace Contributor | Many long-term conservative investors pay atte... |
7 | [7 Tech Stocks to Watch Out For in 2023 … and ... | Jun 16, 2023 | Louis Navellier and the InvestorPlace Research... | Every stock has its ups and downs, but reliabl... |
8 | [3 Smart Takes on 3 Dumb Stocks] | Jun 23, 2023 | Samuel O'Brient, InvestorPlace Financial News ... | Even as tech stocks rally, short sellers are s... |
9 | [3 Smart Takes on 3 Dumb Stocks] | Jun 18, 2023 | Chris Markoch, InvestorPlace Contributor | Here are seven high cash flow stocks that prov... |
Guru Focus¶
In [2]:
Copied!
from finnlp.data_sources.news.gurufocus_streaming import GuruFocus_Streaming
from finnlp.data_sources.news.gurufocus_streaming import GuruFocus_Streaming
In [3]:
Copied!
news_downloader = GuruFocus_Streaming()
news_downloader.download_streaming_search(keyword = "AAPL", rounds = 3)
news_downloader = GuruFocus_Streaming()
news_downloader.download_streaming_search(keyword = "AAPL", rounds = 3)
Only support first page now!
In [5]:
Copied!
selected_columns = ["title", "view" ,"source", "datetime"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "view" ,"source", "datetime"]
news_downloader.dataframe[selected_columns].head(10)
Out[5]:
title | view | source | datetime | |
---|---|---|---|---|
0 | 3 Magic Formula Stocks Popular With Gurus | 0 Views | Margaret Moran | 2023-06-23 17:38 |
1 | Jeremy Grantham: The Super Bubble Is About to Pop | 60 Views | Ben Alaimo | 2023-06-23 09:21 |
2 | 5 High GF Score Stocks That Outperformed the M... | 106 Views | James Li | 2023-06-21 19:36 |
3 | New Feature: DuPont Analysis Chart for Enhance... | 259 Views | Vera Yuan | 2023-06-21 16:55 |
4 | The Most-Sold Guru Stocks of the 1st Quarter | 261 Views | Margaret Moran | 2023-06-16 17:32 |
5 | AI Revolution and Debt Ceiling Resolution | 198 Views | Wade W. Slome, CFA, CFP | 2023-06-05 21:03 |
6 | Nvidia vs. ARK Invest: Which Is the Better Gro... | 332 Views | Joey Frenette | 2023-05-27 02:05 |
7 | Top 5 1st Quarter Trades of CYPRESS ASSET MANA... | 0 Views | GuruFocus Editor | 2023-05-26 14:08 |
8 | Mill Creek Capital Advisors, LLC Buys 2, Sells... | 0 Views | GuruFocus Editor | 2023-05-25 18:10 |
9 | Jim Simons' Renaissance Technologies Chops Pos... | 380 Views | James Li | 2023-05-24 18:43 |
Alliance News¶
In [9]:
Copied!
from finnlp.data_sources.news.alliancenews_streaming import AllianceNews_Streaming
from finnlp.data_sources.news.alliancenews_streaming import AllianceNews_Streaming
In [10]:
Copied!
news_downloader = AllianceNews_Streaming()
news_downloader.download_streaming_search(rounds = 3)
news_downloader = AllianceNews_Streaming()
news_downloader.download_streaming_search(rounds = 3)
In [11]:
Copied!
news_downloader.dataframe.shape
news_downloader.dataframe.shape
Out[11]:
(36, 16)
In [12]:
Copied!
news_downloader.dataframe.head(1)
news_downloader.dataframe.head(1)
Out[12]:
urlId | title | summary | created | updated | thumbnailUrl | source | taxonomies | type | author | meta | sponsor | parent | contentId | displayTaxonomies | parentTaxonomy | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | /news/new-york-market-close-stocks-down-dollar... | NEW YORK MARKET CLOSE: Stocks down, dollar up ... | None | 2023-06-23T21:18:34 | 2023-06-23T21:18:34 | None | {'code': 'ALLIANCE', 'title': 'Alliance News',... | [{'termId': 'CTMRR', 'parentTermId': None, 'ti... | news | None | {'title': 'NEW YORK MARKET CLOSE: Stocks down,... | None | None | al1687551514259519100 | [{'termId': 'TPCOM', 'parentTermId': 'PTMKT', ... | None |
In [13]:
Copied!
selected_columns = ["created", "updated", "title", "summary", "meta"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["created", "updated", "title", "summary", "meta"]
news_downloader.dataframe[selected_columns].head(10)
Out[13]:
created | updated | title | summary | meta | |
---|---|---|---|---|---|
0 | 2023-06-23T21:18:34 | 2023-06-23T21:18:34 | NEW YORK MARKET CLOSE: Stocks down, dollar up ... | None | {'title': 'NEW YORK MARKET CLOSE: Stocks down,... |
1 | 2023-06-23T19:34:05 | 2023-06-23T19:34:05 | IN BRIEF: Blackstone Loan Financing proposes w... | None | {'title': 'IN BRIEF: Blackstone Loan Financing... |
2 | 2023-06-23T18:34:41 | 2023-06-23T18:34:41 | IN BRIEF: Bonhill expects to complete sale of ... | None | {'title': 'IN BRIEF: Bonhill expects to comple... |
3 | 2023-06-23T18:01:27 | 2023-06-23T18:01:27 | UPDATE: SRT Marine Systems raises GBP4.6 milli... | None | {'title': 'UPDATE: SRT Marine Systems raises G... |
4 | 2023-06-23T18:00:27 | 2023-06-23T18:00:27 | IN BRIEF: New Energy One Acquisition confirms ... | None | {'title': 'IN BRIEF: New Energy One Acquisitio... |
5 | 2023-06-23T17:41:15 | 2023-06-23T17:41:15 | IN BRIEF: Kropz makes draw down request on bri... | None | {'title': 'IN BRIEF: Kropz makes draw down req... |
6 | 2023-06-23T17:31:17 | 2023-06-23T17:31:17 | IN BRIEF: XPS Pensions discusses National Pens... | None | {'title': 'IN BRIEF: XPS Pensions discusses Na... |
7 | 2023-06-23T17:25:54 | 2023-06-23T17:25:54 | DIRECTOR DEALINGS: GSK CFO buys shares worth G... | None | {'title': 'DIRECTOR DEALINGS: GSK CFO buys sha... |
8 | 2023-06-23T17:21:29 | 2023-06-23T17:21:29 | IN BRIEF: Gilead Sciences says test results sh... | None | {'title': 'IN BRIEF: Gilead Sciences says test... |
9 | 2023-06-23T17:07:24 | 2023-06-23T17:07:24 | IN THE KNOW: AB Foods "fundamentally strong" w... | None | {'title': 'IN THE KNOW: AB Foods "fundamentall... |
Talk Market¶
In [2]:
Copied!
from finnlp.data_sources.news.talkmarkets_streaming import TalkMarkets_Streaming
from finnlp.data_sources.news.talkmarkets_streaming import TalkMarkets_Streaming
In [3]:
Copied!
news_downloader = TalkMarkets_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = TalkMarkets_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Downloading... 0 1 2
In [4]:
Copied!
news_downloader.dataframe.shape
news_downloader.dataframe.shape
Out[4]:
(60, 12)
In [6]:
Copied!
news_downloader.dataframe.head(1)
news_downloader.dataframe.head(1)
Out[6]:
cacheUrl | clicktrackUrl | content | contentNoFormatting | title | titleNoFormatting | formattedUrl | unescapedUrl | url | visibleUrl | richSnippet | breadcrumbUrl | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | http://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... |
In [7]:
Copied!
selected_columns = ["content", "url", "clicktrackUrl"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["content", "url", "clicktrackUrl"]
news_downloader.dataframe[selected_columns].head(10)
Out[7]:
content | url | clicktrackUrl | |
---|---|---|---|
0 | 23 hours ago <b>...</b> <b>Apple</b>, 187, 3.0... | https://talkmarkets.com/content/global-markets... | https://www.google.com/url?client=internal-ele... |
1 | 1 day ago <b>...</b> Get Adobe Inc. (ADBE:NASD... | https://talkmarkets.com/symbol/adbe/portal-wid... | https://www.google.com/url?client=internal-ele... |
2 | 1 day ago <b>...</b> Get Starbucks Corp (SBUX:... | https://talkmarkets.com/symbol/sbux/portal-wid... | https://www.google.com/url?client=internal-ele... |
3 | 10 hours ago <b>...</b> Wednesday's top an... | https://talkmarkets.com/symbol/pypl/portal-wid... | https://www.google.com/url?client=internal-ele... |
4 | 20 hours ago <b>...</b> <b>Apple</b> (AAPL). <... | https://talkmarkets.com/content/stocks--equiti... | https://www.google.com/url?client=internal-ele... |
5 | 2 days ago <b>...</b> Friday's top analyst... | https://talkmarkets.com/symbol/sofi/portal-wid... | https://www.google.com/url?client=internal-ele... |
6 | 2 days ago <b>...</b> Get Enphase Energy Inc (... | https://talkmarkets.com/symbol/enph/portal-wid... | https://www.google.com/url?client=internal-ele... |
7 | 3 days ago <b>...</b> <b>Apple</b> Inc. design... | https://talkmarkets.com/contributor/jimvanmeer... | https://www.google.com/url?client=internal-ele... |
8 | 3 days ago <b>...</b> <b>Apple</b> Inc. design... | https://talkmarkets.com/content/stocks--equiti... | https://www.google.com/url?client=internal-ele... |
9 | 5 Jan 2023 <b>...</b> Get Amazon.com Inc (AMZN... | https://talkmarkets.com/symbol/amzn/portal-wid... | https://www.google.com/url?client=internal-ele... |
The Fly¶
In [2]:
Copied!
from finnlp.data_sources.news.thefly_streaming import TheFly_Streaming
from finnlp.data_sources.news.thefly_streaming import TheFly_Streaming
In [3]:
Copied!
news_downloader = TheFly_Streaming()
news_downloader.download_streaming_search(keyword = "AAPL", rounds = 3)
news_downloader = TheFly_Streaming()
news_downloader.download_streaming_search(keyword = "AAPL", rounds = 3)
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 warnings.warn(
Only support the first page now!
In [5]:
Copied!
selected_columns = ["title", "stock", "abstract", "date", "time"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "stock", "abstract", "date", "time"]
news_downloader.dataframe[selected_columns].head(10)
Out[5]:
title | stock | abstract | date | time | |
---|---|---|---|---|---|
0 | Apple in talks to launch Apple Card in India, ... | AAPL | Apple is in talks to… | 06/23/23 | 05:37 |
1 | Apple says visionOS software development kit n... | AAPL | Apple announced the… | 06/21/23 | 16:03 |
2 | Apple to create spatial experiences for Apple ... | AAPL | Apple "announced the… | 06/21/23 | 16:00 |
3 | Notable open interest changes for June 21st | TSLA NVDA AAPL AMZN | Tuesday's total… | 06/21/23 | 08:55 |
4 | What You Missed This Week in Video Games | TCEHY TTWO EA CCOEY UBSFY CMCSK CMCSA RBLX AAP... | "Game On" is The Fly's… | 06/20/23 | 12:11 |
5 | Notable open interest changes for June 20th | TSLA AMC AAPL NVDA | Friday's total… | 06/20/23 | 08:55 |
6 | Apple call buyer realizes 20% same-day gains | AAPL | Notable profits for the… | 06/16/23 | 08:00 |
7 | Notable open interest changes for June 15th | TSLA NVDA SOFI AAPL | Wednesday's total… | 06/15/23 | 08:55 |
8 | US senators propose bill to eliminate Section ... | GOOG MSFT AMZN AAPL NVDA IBM META INTC | "U.S. Senators Josh… | 06/14/23 | 17:54 |
9 | #SocialStocks: Twitter skips out on rent and G... | TWTR AAPL META GOOGL GOOG ZM RBLX PINS | Welcome to… | 06/14/23 | 15:57 |
Tip Rank¶
In [5]:
Copied!
from finnlp.data_sources.news.tipranks_streaming import TipRanks_Streaming
from finnlp.data_sources.news.tipranks_streaming import TipRanks_Streaming
In [6]:
Copied!
news_downloader = TipRanks_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = TipRanks_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Downloading: 0 1 2
In [7]:
Copied!
news_downloader.dataframe.head(2)
news_downloader.dataframe.head(2)
Out[7]:
stocks | _id | author | category | date | description | image | isLocked | link | lockType | slug | sticky | thumbnail | title | topics | timeAgo | badge | id | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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/... | True | https://www.tipranks.com/news/aapl-notches-up-... | GraceCount | aapl-notches-up-following-barclays-comments | False | {'src': 'https://blog.tipranks.com/wp-content/... | AAPL Notches Up Following Barclays Comments | [{'id': 0, 'type': 'stock', 'title': 'AAPL', '... | 13h | None | 582530 |
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/... | True | https://www.tipranks.com/news/article/affirm-s... | GraceCount | affirm-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', '... | 4d | None | 579043 |
In [8]:
Copied!
selected_columns = ["stocks", "date", "author", "title", "description"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["stocks", "date", "author", "title", "description"]
news_downloader.dataframe[selected_columns].head(10)
Out[8]:
stocks | date | author | title | description | |
---|---|---|---|---|---|
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&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 ... |
Market Watch (Date Range)¶
In [2]:
Copied!
from finnlp.data_sources.news.marketwatch_date_range import MarketWatch_Date_Range
from finnlp.data_sources.news.marketwatch_date_range import MarketWatch_Date_Range
In [3]:
Copied!
start_date = "2022-06-01"
end_date = "2022-06-30"
keyword = "apple"
start_date = "2022-06-01"
end_date = "2022-06-30"
keyword = "apple"
In [4]:
Copied!
news_downloader = MarketWatch_Date_Range()
news_downloader.download_date_range_search(keyword = "apple", start_date = start_date, end_date = end_date)
news_downloader = MarketWatch_Date_Range()
news_downloader.download_date_range_search(keyword = "apple", start_date = start_date, end_date = end_date)
Only support the first page now!
In [5]:
Copied!
selected_columns = ["title", "time", "author"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "time", "author"]
news_downloader.dataframe[selected_columns].head(10)
Out[5]:
title | time | author | |
---|---|---|---|
0 | Gold falls more than 2% for the month, settles... | Jun. 30, 2022 at 2:47 p.m. ET | by Joseph Adinolfi |
1 | AMD stock gets an upgrade as analyst says rece... | Jun. 30, 2022 at 12:07 p.m. ET | by Emily Bary |
2 | All 30 Dow stocks are falling, with Goldman Sa... | Jun. 30, 2022 at 9:47 a.m. ET | by Tomi Kilgore |
3 | Here’s how far oil could fall in a recession, ... | Jun. 30, 2022 at 8:34 a.m. ET | by Steve Goldstein |
4 | Crypto Winter Is Coming After SEC Rejects Key ... | Jun. 30, 2022 at 6:37 a.m. ET | |
5 | An FCC Commissioner Wants TikTok Yanked From A... | Jun. 30, 2022 at 3:27 a.m. ET | by Barron's |
6 | Meta Has a New Problem. Profit Forecasts Now L... | Jun. 29, 2022 at 1:18 p.m. ET | by Barron's |
7 | Fed rolls out new index to flag early warning ... | Jun. 29, 2022 at 1:04 p.m. ET | by Joy Wiltermuth |
8 | Apple Investors Have Something New to Focus On... | Jun. 29, 2022 at 12:41 p.m. ET | by Barron's |
9 | Here’s why this trader is piling back into one... | Jun. 29, 2022 at 10:34 a.m. ET | by Barbara Kollmeyer |
Market Watch (Streaming)¶
In [3]:
Copied!
from finnlp.data_sources.news.marketwatch_streaming import MarketWatch_Streaming
from finnlp.data_sources.news.marketwatch_streaming import MarketWatch_Streaming
In [4]:
Copied!
news_downloader = MarketWatch_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = MarketWatch_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Only support the first page now!
In [5]:
Copied!
selected_columns = ["title", "time", "author"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "time", "author"]
news_downloader.dataframe[selected_columns].head(10)
Out[5]:
title | time | author | |
---|---|---|---|
0 | Tech IPOs Should Be Heating Up. Why They’re Not. | Jun. 23, 2023 at 2:51 a.m. ET | by Barron's |
1 | Everything Is Going Right for Tesla. It’s Time... | Jun. 23, 2023 at 1:30 a.m. ET | by Barron's |
2 | India’s Modi cracks jokes, chows down at swank... | Jun. 22, 2023 at 11:38 p.m. ET | by Associated Press |
3 | Work-From-Home Job Openings Are Shrinking | Jun. 22, 2023 at 6:23 p.m. ET | by Barron's |
4 | Congress Blasts E-Commerce Firm Temu Over Forc... | Jun. 22, 2023 at 5:44 p.m. ET | by Barron's |
5 | Meta Platforms Inc. stock outperforms market o... | Jun. 22, 2023 at 5:32 p.m. ET | by MarketWatch Automation |
6 | Microsoft Corp. stock outperforms competitors ... | Jun. 22, 2023 at 5:32 p.m. ET | by MarketWatch Automation |
7 | Netflix Inc. stock underperforms Thursday when... | Jun. 22, 2023 at 5:32 p.m. ET | by MarketWatch Automation |
8 | GameStop Corp. Cl A stock underperforms Thursd... | Jun. 22, 2023 at 5:29 p.m. ET | by MarketWatch Automation |
9 | Amazon.com Inc. stock outperforms market on st... | Jun. 22, 2023 at 5:25 p.m. ET | by MarketWatch Automation |
Penny Stock¶
In [2]:
Copied!
from finnlp.data_sources.news.pennystocks_streaming import PennyStocks_Streaming
from finnlp.data_sources.news.pennystocks_streaming import PennyStocks_Streaming
In [3]:
Copied!
news_downloader = PennyStocks_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = PennyStocks_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Requesting https://pennystocks.com ... succeed! Gathering again .. Remaining Retry: 4 Only support the first page now!
In [4]:
Copied!
selected_columns = ["title", "time", "brief", "reading_time"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "time", "brief", "reading_time"]
news_downloader.dataframe[selected_columns].head(10)
Out[4]:
title | time | brief | reading_time | |
---|---|---|---|---|
0 | Best 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 |
0 | What 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 |
0 | 3 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.\n | 4 minute read |
0 | Penny 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 |
0 | Best 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 |
0 | Penny 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 |
0 | Penny 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 |
0 | What 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 |
0 | Trading 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 |
0 | Fed 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 |
Seeking Alpha¶
In [7]:
Copied!
from finnlp.data_sources.news.seekingalpha_date_range import SeekingAlpha_Date_Range
from finnlp.data_sources.news.seekingalpha_date_range import SeekingAlpha_Date_Range
In [5]:
Copied!
start_date = "2023-06-01"
end_date = "2023-06-30"
stock = "AAPL"
start_date = "2023-06-01"
end_date = "2023-06-30"
stock = "AAPL"
In [8]:
Copied!
news_downloader = SeekingAlpha_Date_Range()
news_downloader.download_date_range_stock(start_date, end_date, stock)
news_downloader = SeekingAlpha_Date_Range()
news_downloader.download_date_range_stock(start_date, end_date, stock)
Downloading Titles: 100%|██████████| 1/1 [00:00<?, ?it/s]
In [11]:
Copied!
selected_columns = ["publishOn","title","commentCount"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["publishOn","title","commentCount"]
news_downloader.dataframe[selected_columns].head(10)
Out[11]:
publishOn | title | commentCount | |
---|---|---|---|
0 | 2023-06-19T09:00:00-04:00 | Artificial intelligence is a '1995 moment' for... | 63 |
1 | 2023-06-16T11:59:46-04:00 | Citi: Don't worry about Big Tech fueling 2023'... | 17 |
2 | 2023-06-15T07:20:12-04:00 | Google said to temper chatbot use for employee... | 8 |
3 | 2023-06-14T05:17:31-04:00 | Nvidia crosses $1T market cap powered by the r... | 36 |
4 | 2023-06-13T17:17:00-04:00 | Intel in talks to be anchor investor in chip d... | 94 |
5 | 2023-06-13T12:14:45-04:00 | Hot Stocks: AAPL falls on downgrade; MANU rise... | 3 |
6 | 2023-06-13T06:22:59-04:00 | Apple notches record close as bulls continue t... | 18 |
7 | 2023-06-13T04:49:26-04:00 | Apple cut to Neutral at UBS on softer iPhone a... | 26 |
8 | 2023-06-09T05:42:17-04:00 | AI looking like a 'winner-take-more' game - Go... | 39 |
9 | 2023-06-09T05:21:04-04:00 | Zuckerberg's vision for AR/VR headsets differe... | 92 |
Reuters¶
In [2]:
Copied!
from finnlp.data_sources.news.reuters_streaming import Reuters_Streaming
from finnlp.data_sources.news.reuters_streaming import Reuters_Streaming
In [3]:
Copied!
news_downloader = Reuters_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
news_downloader = Reuters_Streaming()
news_downloader.download_streaming_search(keyword = "apple", rounds = 3)
Geting pages: 1 2 3
In [4]:
Copied!
selected_columns = ["published_time","title","description"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["published_time","title","description"]
news_downloader.dataframe[selected_columns].head(10)
Out[4]:
published_time | title | description | |
---|---|---|---|
0 | 2023-06-19T10:17:24.474Z | Hong Kong tycoon Jimmy Lai loses appeal agains... | A Hong Kong appeal court on Monday blocked jai... |
1 | 2023-06-19T09:49:09.391Z | Podcast: Blinken meets Xi and Chinese bankers ... | U.S. Secretary of State Anthony Blinken is in ... |
2 | 2023-06-19T02:10:24.581Z | Their parents made China the world's factory. ... | When Steven Du took over his parents' factory ... |
3 | 2023-06-17T08:14:15.708Z | Japan to open up Apple- and Google-dominated p... | Japan plans to stoke competition in smartphone... |
4 | 2023-06-16T13:28:02.538Z | Khashoggi's widow sues Israeli spyware company... | The widow of murdered Saudi journalist Jamal K... |
5 | 2023-06-16T11:12:02.899Z | Factbox: DLE companies racing to reshape globa... | Lithium, the metal used to make electric vehic... |
6 | 2023-06-16T10:17:23.831Z | Podcast: US-Iran talks and Australia divided o... | Australia is divided on a historic referendum ... |
7 | 2023-06-16T02:16:44.523Z | Chinese e-commerce giants entice cautious cons... | China's e-commerce platforms are competing fie... |
8 | 2023-06-15T10:21:02.697Z | S&P 500 leaps to highest close in 14 months; t... | The S&P 500 and Nasdaq surged on Thursday to c... |
9 | 2023-06-15T19:49:27.459Z | Microsoft notches record high valuation of nea... | Microsoft Corp shares rose to a new record hig... |
Sina Finance¶
In [2]:
Copied!
from finnlp.data_sources.news.sina_finance_date_range import Sina_Finance_Date_Range
from finnlp.data_sources.news.sina_finance_date_range import Sina_Finance_Date_Range
In [3]:
Copied!
start_date = "2016-01-01"
end_date = "2016-01-01"
config = {
"use_proxy": "china_free",
"max_retry": 5,
"proxy_pages": 5,
}
start_date = "2016-01-01"
end_date = "2016-01-01"
config = {
"use_proxy": "china_free",
"max_retry": 5,
"proxy_pages": 5,
}
In [4]:
Copied!
news_downloader = Sina_Finance_Date_Range(config)
news_downloader.download_date_range_all(start_date,end_date)
news_downloader.gather_content()
news_downloader = Sina_Finance_Date_Range(config)
news_downloader.download_date_range_all(start_date,end_date)
news_downloader.gather_content()
Gathering free ips by pages...: 100%|██████████| 5/5 [00:04<00:00, 1.05it/s] Checking ips: 100%|██████████| 75/75 [00:20<00:00, 3.67it/s]
获取到的代理ip数量: 75 。Get proxy ips: 75. 能用的代理数量: 75。Usable proxy ips: 75.
Downloading Titles...: 100%|██████████| 1/1 [00:01<00:00, 1.54s/it] Gathering news contents: 100%|██████████| 103/103 [00:22<00:00, 4.50it/s]
In [5]:
Copied!
selected_columns = ["title", "content"]
news_downloader.dataframe[selected_columns].head(10)
selected_columns = ["title", "content"]
news_downloader.dataframe[selected_columns].head(10)
Out[5]:
title | content | |
---|---|---|
0 | 分析师:伊朗重回国际原油市场无法阻止 | 新浪美股讯 北京时间1月1日晚CNBC称,加拿大皇家银行(RBC)分析师Helima Cro... |
1 | FAA:波音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 | 中国首家国有船厂破产倒闭:五洲船舶目前已停工 | 低迷的中国造船市场,多年来首次出现国有船厂破产清算的一幕。浙江海运集团旗下的五洲船舶修造公司... |
Eastmoney¶
In [2]:
Copied!
from finnlp.data_sources.news.eastmoney_streaming import Eastmoney_Streaming
from finnlp.data_sources.news.eastmoney_streaming import Eastmoney_Streaming
In [3]:
Copied!
pages = 3
stock = "600519"
config = {
"use_proxy": "china_free",
"max_retry": 5,
"proxy_pages": 5,
}
pages = 3
stock = "600519"
config = {
"use_proxy": "china_free",
"max_retry": 5,
"proxy_pages": 5,
}
In [4]:
Copied!
news_downloader = Eastmoney_Streaming(config)
news_downloader.download_streaming_stock(stock,pages)
news_downloader = Eastmoney_Streaming(config)
news_downloader.download_streaming_stock(stock,pages)
Gathering free ips by pages...: 100%|██████████| 5/5 [00:04<00:00, 1.08it/s] Checking ips: 100%|██████████| 75/75 [00:20<00:00, 3.62it/s]
获取到的代理ip数量: 75 。Get proxy ips: 75. 能用的代理数量: 75。Usable proxy ips: 75. Geting pages: 0 1 2 Get total 3 pages.
In [5]:
Copied!
selected_columns = ["title", "create time"]
news_downloader[selected_columns].dataframe.head(10)
selected_columns = ["title", "create time"]
news_downloader[selected_columns].dataframe.head(10)
Out[5]:
read amount | comments | title | content link | author | create time | |
---|---|---|---|---|---|---|
0 | 1407 | 6 | 茅台2022年报的12个小秘密 | /news,600519,1295554981.html | 贵州茅台资讯 | 04-09 19:40 |
1 | 234 | 0 | 东北证券维持贵州茅台买入评级 预计2023年净利润同比 | /news,600519,1295512910.html | 公司研报提示 | 04-09 11:24 |
2 | 385 | 0 | 贵州茅台:融资余额169.34亿元,创近一年新低(04-07 | /news,600519,1295407809.html | 贵州茅台资讯 | 04-08 07:30 |
3 | 233 | 0 | 贵州茅台:融资净买入1248.48万元,融资余额169.79亿 | /news,600519,1294929438.html | 贵州茅台资讯 | 04-07 07:28 |
4 | 2804 | 16 | 贵州茅台公益基金会正式成立 | /news,600519,1294612056.html | 贵州茅台资讯 | 04-06 12:29 |
5 | 333 | 0 | 贵州茅台04月04日获沪股通增持19.55万股 | /news,600519,1294268016.html | 贵州茅台资讯 | 04-05 07:48 |
6 | 312 | 0 | 贵州茅台:融资余额169.66亿元,创近一年新低(04-04 | /news,600519,1294265710.html | 贵州茅台资讯 | 04-05 07:30 |
7 | 22721 | 16 | 4月4日北向资金最新动向(附十大成交股) | /news,600519,1294192188.html | 贵州茅台资讯 | 04-04 18:48 |
8 | 654 | 1 | 大宗交易:贵州茅台成交235.9万元,成交价1814.59元( | /news,600519,1294173281.html | 贵州茅台资讯 | 04-04 17:21 |
9 | 233 | 0 | 第一上海证券维持贵州茅台买入评级 目标价2428.8元 | /news,600519,1293784734.html | 公司研报提示 | 04-04 09:30 |
Finnhub / Yahoo¶
In [2]:
Copied!
from finnlp.data_sources.news.finnhub_date_range import Finnhub_Date_Range
from finnlp.data_sources.news.finnhub_date_range import Finnhub_Date_Range
In [3]:
Copied!
start_date = "2023-01-01"
end_date = "2023-01-03"
config = {
"use_proxy": "us_free",
"max_retry": 5,
"proxy_pages": 5,
"token": "YOUR_FINNHUB_TOKEN" # Avaliable at https://finnhub.io/dashboard
}
start_date = "2023-01-01"
end_date = "2023-01-03"
config = {
"use_proxy": "us_free",
"max_retry": 5,
"proxy_pages": 5,
"token": "YOUR_FINNHUB_TOKEN" # Avaliable at https://finnhub.io/dashboard
}
In [4]:
Copied!
news_downloader = Finnhub_Date_Range(config)
news_downloader.download_date_range_stock(start_date,end_date)
news_downloader.gather_content()
news_downloader = Finnhub_Date_Range(config)
news_downloader.download_date_range_stock(start_date,end_date)
news_downloader.gather_content()
Checking ips: 100%|██████████| 75/75 [02:51<00:00, 2.28s/it]
Get proxy ips: 75. Usable proxy ips: 75.
Downloading Titles: 100%|██████████| 1/1 [00:02<00:00, 2.66s/it] 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 InsecureRequestWarning, Gathering news contents: 100%|██████████| 102/102 [06:15<00:00, 3.68s/it]
In [6]:
Copied!
df = news_downloader.dataframe
df.head(2)
df = news_downloader.dataframe
df.head(2)
Out[6]:
category | datetime | headline | id | image | related | source | summary | url | content | |
---|---|---|---|---|---|---|---|---|---|---|
0 | company | 2023-01-03 23:40:08 | My 26-Stock $349k Portfolio Gets A Nice Petrob... | 118107004 | https://media.gettyimages.com/id/1441204186/ph... | AAPL | SeekingAlpha | My portfolio, built specifically for my retire... | https://finnhub.io/api/news?id=d3c15f6f365663b... | Home\nInvesting Strategy\nPortfolio Strategy\n... |
1 | company | 2023-01-03 22:09:00 | Apple’s Market Cap Slides Below $2 Trillion fo... | 118105849 | AAPL | Yahoo | The tech giant is one of only five U.S. compan... | https://finnhub.io/api/news?id=42343678a7474e1... | Error |
In [8]:
Copied!
selected_columns = ["headline", "content"]
df[selected_columns].head(10)
selected_columns = ["headline", "content"]
df[selected_columns].head(10)
Out[8]:
headline | content | |
---|---|---|
0 | My 26-Stock $349k Portfolio Gets A Nice Petrob... | Home\nInvesting Strategy\nPortfolio Strategy\n... |
1 | Apple’s Market Cap Slides Below $2 Trillion fo... | Error |
2 | US STOCKS-Wall St starts the year with a dip; ... | (For a Reuters live blog on U.S., UK and Europ... |
3 | Buy 4 January Dogs Of The Dow, Watch 4 More | Home\nDividends\nDividend Quick Picks\nBuy 4 J... |
4 | Apple's stock market value falls below $2 tril... | Jan 3 (Reuters) - Apple Inc's \n(AAPL.O)\n sto... |
5 | CORRECTED-UPDATE 1-Apple's stock market value ... | Jan 3 (Reuters) - Apple Inc's \n(AAPL.O)\n sto... |
6 | Apple Stock Falls Amid Report Of Product Order... | Apple stock got off to a slow start in 2023 as... |
7 | US STOCKS-Wall St starts the year with a dip; ... | Summary\nCompanies\nTesla shares plunge on Q4 ... |
8 | More than $1 trillion wiped off value of Apple... | apple store\nMore than $1 trillion has been wi... |
9 | McLean's Iridium inks agreement to put its sat... | The company hasn't named its partner, but it's... |
In [ ]:
Copied!