使用 RVEST 抓取纳斯达克网站时崩溃
Crash when Scraping Nasdaq website with RVEST
我正在尝试 抓取 这个网站 https://www.nasdaq.com/market-activity/ipos 以获取未上市和定价的 IPO 表,但 Rstudio 总是崩溃我使用 rvest。
这是我的代码:
library(rvest)
url="https://www.nasdaq.com/market-activity/ipos"
web <- read_html(url)
datos_web <- web %>%
html_nodes(xpath = '//*[@class="market-calendar-table__table"]') %>%
html_table()
如何将这些表放入数据框中?
我不知道网站上是否发生了某些变化,但您可以从 this link 中获取所需的数据,这是我在网页的“网络”选项卡中找到的。
library(jsonlite)
data <- fromJSON('https://api.nasdaq.com/api/ipo/calendar?date=2021-11')
data$data$upcoming$upcomingTable$rows
# dealID proposedTickerSymbol companyName proposedExchange
#1 816750-100864 SG Sweetgreen, Inc. NYSE
#2 1182126-100788 KLC KC Holdco, LLC NYSE
#3 1171463-98726 HORIU Emerging Markets Horizon Corp. NASDAQ Global
#4 888571-100721 USER UserTesting, Inc. NYSE
#5 1183593-100874 IREN Iris Energy Ltd NASDAQ Global Select
#6 1028510-100829 BRZE Braze, Inc. NASDAQ Global Select
#7 1160405-97685 IRRXU INTEGRATED RAIL & RESOURCES ACQUISITION CORP NYSE
# proposedSharePrice sharesOffered expectedPriceDate dollarValueOfSharesOffered
#1 23.00-25.00 12,500,000 11/18/2021 9,375,000
#2 18.00-21.00 25,775,434 11/18/2021 2,476,729.00
#3 10.00 25,000,000 11/18/2021 7,500,000
#4 15.00-17.00 14,169,407 11/17/2021 7,011,906.00
#5 25.00-27.00 8,269,231 11/17/2021 6,759,605.00
#6 55.00-60.00 8,000,000 11/17/2021 8,000,000.00
#7 10.00 20,000,000 11/12/2021 0,000,000
同样,定价数据可以在data$data$priced$rows
找到。
我正在尝试 抓取 这个网站 https://www.nasdaq.com/market-activity/ipos 以获取未上市和定价的 IPO 表,但 Rstudio 总是崩溃我使用 rvest。
这是我的代码:
library(rvest)
url="https://www.nasdaq.com/market-activity/ipos"
web <- read_html(url)
datos_web <- web %>%
html_nodes(xpath = '//*[@class="market-calendar-table__table"]') %>%
html_table()
如何将这些表放入数据框中?
我不知道网站上是否发生了某些变化,但您可以从 this link 中获取所需的数据,这是我在网页的“网络”选项卡中找到的。
library(jsonlite)
data <- fromJSON('https://api.nasdaq.com/api/ipo/calendar?date=2021-11')
data$data$upcoming$upcomingTable$rows
# dealID proposedTickerSymbol companyName proposedExchange
#1 816750-100864 SG Sweetgreen, Inc. NYSE
#2 1182126-100788 KLC KC Holdco, LLC NYSE
#3 1171463-98726 HORIU Emerging Markets Horizon Corp. NASDAQ Global
#4 888571-100721 USER UserTesting, Inc. NYSE
#5 1183593-100874 IREN Iris Energy Ltd NASDAQ Global Select
#6 1028510-100829 BRZE Braze, Inc. NASDAQ Global Select
#7 1160405-97685 IRRXU INTEGRATED RAIL & RESOURCES ACQUISITION CORP NYSE
# proposedSharePrice sharesOffered expectedPriceDate dollarValueOfSharesOffered
#1 23.00-25.00 12,500,000 11/18/2021 9,375,000
#2 18.00-21.00 25,775,434 11/18/2021 2,476,729.00
#3 10.00 25,000,000 11/18/2021 7,500,000
#4 15.00-17.00 14,169,407 11/17/2021 7,011,906.00
#5 25.00-27.00 8,269,231 11/17/2021 6,759,605.00
#6 55.00-60.00 8,000,000 11/17/2021 8,000,000.00
#7 10.00 20,000,000 11/12/2021 0,000,000
同样,定价数据可以在data$data$priced$rows
找到。