-4

I have the following formula:

=VALUE(IMPORTXML("https://finance.yahoo.com/quote/"$A2,"/html/body/div[1]/div/div/div[1]/div/div[3]/div[2]/div/div/div/div/div/div[13]/div/div/div/div/div/div/p[2]/span[2]"))

Using the GE ticker as an example (in the A2 box), I am trying to scrape the result for "Sector(s):" which in this case is "Industrials" but it can vary. I tried pasting the formula into C2 but it would be nice if it could parse down the A column and provide the answers down the C column.

Please inform me, thanks.

eglease
  • 2,445
  • 11
  • 18
  • 28
  • OpenAI provided a fix but it's still incorrect. Maybe the following result will help too: =ARRAYFORMULA(IF(A2:A<>"", VALUE(IMPORTXML("https://finance.yahoo.com/quote/" & A2:A, "//span[contains(text(),'Sector(s):')]/following-sibling::span")), "")) – wheresjohnnywalker Aug 09 '23 at 17:26
  • Please read the Help Center: `AI-assisted Generated Content Ban Please be aware that all AI-assisted generated content (including ChatGPT) is currently banned.` – Tedinoz Aug 10 '23 at 06:01
  • Does this answer your question? [Scraping data to Google Sheets from a website that uses JavaScript](https://stackoverflow.com/questions/74237688/scraping-data-to-google-sheets-from-a-website-that-uses-javascript) – Tedinoz Aug 10 '23 at 06:06

0 Answers0