I am trying to import the "About" company data from Google Finance into a Google Sheet.
For instance, on AirBnB's Google Finance page https://www.google.com/finance/quote/ABNB:NASDAQ, there is an About section on the left hand panel. It appears to get data from wikipedia. It says:
*"About
Airbnb, Inc. is an American company that operates an online marketplace for lodging, primarily homestays for vacation rentals, and tourism activities. Based in San Francisco, California, the platform is accessible via website and mobile app. Airbnb does not own any of the listed properties; instead, it profits by receiving commission from each booking. The company was founded in 2008 by Brian Chesky, Nathan Blecharczyk and Joe Gebbia. Airbnb is a shortened version of its original name, AirBedandBreakfast.com. The company has been criticized for possibly driving up home rents and creating nuisances for those living near leased properties. The company is regulated by many jurisdictions, including the European Union and cities such as San Francisco and New York City. It is viewed as a competitive threat by the hotel industry. Wikipedia"*
I'd like to import this data into Google Sheets for a list of stocks. I have the stock codes and exchanges in a google sheet, and using CONCATENATE I've combined them, then using the same function have the full Google Finance URL, then using that URL I'm trying to use the IMPORTXML function, along with TEXTJOIN so it is in one cell.
So far, I can find the xpath using Inspector in Chrome, and copy full xpath. I can get one result, but it does not work across all the other stocks I am looking up. I also get a bit of other text that I don't want, which is appearing before the text I need. Here is the result I am getting, the unwanted text is in bold:
"Previous closeThe last closing priceDay rangeThe difference between the high and low prices over the past dayYear rangeThe difference between the high and low prices over the past 52 weeksMarket capA valuation method that multiplies the price of a company's stock by the total number of outstanding shares.VolumeThe average number of shares traded each day over the past 30 daysP/E ratioThe ratio of current share price to trailing twelve month EPS that signals if the price is high or low compared to other stocksDividend yieldThe ratio of annual dividend to current share price that estimates the dividend return of a stockPrimary exchangeListed exchange for this securityAirbnb, Inc. is an American company that operates an online marketplace for lodging, primarily homestays for vacation rentals, and tourism activities. Based in San Francisco, California, the platform is accessible via website and mobile app. Airbnb does not own any of the listed properties; instead, it profits by receiving commission from each booking. The company was founded in 2008 by Brian Chesky, Nathan Blecharczyk and Joe Gebbia. Airbnb is a shortened version of its original name, AirBedandBreakfast.com. The company has been criticized for possibly driving up home rents and creating nuisances for those living near leased properties. The company is regulated by many jurisdictions, including the European Union and cities such as San Francisco and New York City. It is viewed as a competitive threat by the hotel industry. "
This is the formula I am using:
=TEXTJOIN("",TRUE,(IMPORTXML("https://www.google.com/finance/quote/ABNB:NASDAQ","/html/body/c-wiz/div/div/div/div/main/div/div/div/span/div/text()")))
So I have two issues:
Any help is greatly appreciated, thanks. I've looked at a few tutorials and other questions here, but can't find an answer that works.
For xpath, try this
=importxml(url,"//div[@class='bLLb2d']")