Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to pull in stock ticker data from google.com/finance for different stocks and have gotten the error -
"Expression.Error: 7 arguments were passed to a function which expects between 1 and 2. Details: Pattern= Arguments=[List]"
My current query is the following -
let
Source = Web.BrowserContents("https://www.google.com/finance/quote/DAL:NYSE", "https://www.google.com/finance/quote/NI:NYSE", "https://www.google.com/finance/quote/DG:NYSE", "https://www.google.com/finance/quote/MSFT:NASDAQ", "https://www.google.com/finance/quote/BBY:NYSE", "https://www.google.com/finance/quote/GOOG:NASDAQ"),
#"Extracted Table From Html" = Html.Table(Source, {{"Ticker", ".PdOqHc"}, {"Price", "[jsname=""LXPcOd""]"}, {"Amount Change", ".ZYVHBb"}, {"Prev Close", ".gyFHrc:nth-last-child(9) > .P6K39c"}}, [RowSelector=".PdOqHc"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Ticker", type text}, {"Price", type text}, {"Amount Change", type text}, {"Prev Close", type text}})
in
#"Changed Type"
I believe the issue stems from having multiple web browser contents, but not sure how else to pull in multiple stocks. Thanks in advance
Solved! Go to Solution.
Hi @Syndicate_Admin ,
It looks like the error message is indicating that the Web.BrowserContents function is expecting 1 or 2 arguments, but you are passing in 6.
Instead of using multiple Web.BrowserContents functions, you could try using the Web.Page function to load the page once and then extract the data for each stock ticker using a loop or list. Here's an example of how you could modify your query to use the Web.Page function:
let
tickers = {"DAL:NYSE", "NI:NYSE", "DG:NYSE", "MSFT:NASDAQ", "BBY:NYSE", "GOOG:NASDAQ"},
url = "https://www.google.com/finance/quote/",
stockData = List.Transform(
tickers,
each
let
tickerUrl = url & _,
page = Web.Page(tickerUrl),
table = page{0}[Data]
in
table
),
combinedData = Table.Combine(stockData)
in
combinedData
This code creates a list of ticker symbols, constructs the URL for each ticker, loads the page using Web.Page, extracts the data table from each page, and then combines all of the tables into a single table.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
I am not sure I understand this. I am a new power apps user. By applying the query you provided, it results in the following:
Are there additional steps I should be taking after applying your query into the editor in order to get the ticker, price, amount change, and previous close data from the website? Thanks in advance
Hi @Syndicate_Admin ,
It looks like the error message is indicating that the Web.BrowserContents function is expecting 1 or 2 arguments, but you are passing in 6.
Instead of using multiple Web.BrowserContents functions, you could try using the Web.Page function to load the page once and then extract the data for each stock ticker using a loop or list. Here's an example of how you could modify your query to use the Web.Page function:
let
tickers = {"DAL:NYSE", "NI:NYSE", "DG:NYSE", "MSFT:NASDAQ", "BBY:NYSE", "GOOG:NASDAQ"},
url = "https://www.google.com/finance/quote/",
stockData = List.Transform(
tickers,
each
let
tickerUrl = url & _,
page = Web.Page(tickerUrl),
table = page{0}[Data]
in
table
),
combinedData = Table.Combine(stockData)
in
combinedData
This code creates a list of ticker symbols, constructs the URL for each ticker, loads the page using Web.Page, extracts the data table from each page, and then combines all of the tables into a single table.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.