Google ImportXML to Scrape Prices off TIAA.org - xpath

A number of investments from TIAA.org are not traded on exchanges and not available via a ticker symbol thru say GoogleFinance etc. For one of these I would like to 'scrape' the daily price directly off of TIAA.org website and into a cell auto-magically.
In Google sheets I thought it would be easy enough using ImportHTML as a table but no luck. I've experimented with ImportXML but cannot seem to figure out how to set the xpath query for the specific price I'm interested in and leaving me confused - keep ending up with a "N/A" cell ("Error: Imported content is empty").
Using this URL:
https://www.tiaa.org/public/investment-performance/tiaavariableannuity/profile?ticker=41091375
Could someone take a look and suggest how I might import the daily price (aka unit value) for QREARX into a Google sheet cell using an xpath with ImportXML or other method?
Thanks

If you slightly change your url prefix to https://www.tiaa.org/public/tcfpi/Investment/Portfolio?symbol= and then add your ticket number at the end like you did in your example: 41091375
then you can use this importxml function to pull in the value your looking for:
=IMPORTXML("https://www.tiaa.org/public/tcfpi/Investment/Portfolio?symbol=41091375","//*[#class='first']/text()")

Related

How to filter multiple classes in XPath GoogleSheet ImportXML function to get the desire output

How can I filter the XPath by multiple class to get the data for each year in Table format?
Current code:
=IMPORTXML(CONCATENATE("https://www.google.com/finance/quote/",C2,":NASDAQ"),"//table//tr[contains(#class,'roXhBd')]")
C2 is a reference cell in excel which can be any ticker
Current output
Desired Output
I think GOOGLEFINANCE() formula in Google Sheets is better for this kind of extraction.
You can get many parameters for any ticker:
https://support.google.com/docs/answer/3093281?hl=en
You can import long datasets and parameters in intervals you want and play in your spreadsheet without importxml.
IMPORTXML returns only values that are visible on the website. In order to find a solution, you should find a way to manipulate URL to get you right date ranges. I can't see this option on the site you link.

Google Sheets: dynamic sum-formula of multiple sheets

I'm working on a call tracking sheet for our sales teams to see their numbers.
Now I've following case I don't know how to solve.
Every sales person has his own sheet with his name.
In the main sheet I want to add up the data from all sellers, which currently happens via the following formula:
='Closer 1'!C4+'Closer 2'!C4+'Closer 3'!C4+'Closer 4'!C4+'Closer 5'!C4+'Closer 6'!C4+'Closer 7'!C4+'Closer 8'!C4
My question now is, how can I dynamically extend the formula with a database table so that when another seller is added, I don't have to adjust a formula?
That the formula is automatically supplemented by the additional person?
Here I added a picture how does it look like: Picture 1
The Sheet of a sales person looks like: Picture 2
Because It would need really much time to change all the formulas for every day of the year.
Thank you very much for your help guys!
My idea is to use INDIRECT function and store sellers names in sum sheet.
This formula treats string as a reference so you can take sheetnames from your spreadsheet.
My sheet you can find here:
https://docs.google.com/spreadsheets/d/1f31vxTFhAvmPNzx5oIleZHYfyxnFz73jCHkbP6_5hmA/copy

Get meaning for a word from dictionary Using XPath Google sheets importxml function

I'm trying to use the IMPORTXML function in Google sheets to grab the meaning and information words on https://www.powerthesaurus.org/
I kind of succeeded getting some data from another website, but as a newbie, I got some troubles to get any data when I try on this one in this Google sheet in D6 cell.
=ImportXML("https://www.powerthesaurus.org/"&A6,"//*[#id='link link--primary link--term']")
Could someone help to educate me with the correct formula?
You're looking for synonyms. Note you can display up to 200 on Power Thesaurus.
To get the 50 first synonyms in one cell (since you have one word per row), you can try this :
Create 50 numbered columns in your GoogleSheet.
Apply this formula to the first cell and drag it to the right.
=IMPORTXML("https://www.powerthesaurus.org/abbreviation/synonyms";"(//div[#class='pt-thesaurus-card__term'])"&"["&B2&"]")
Then use join formula to get all the words in one cell (XX:XX is the range of your columns, B3:F3 on the provided screenshot).
=JOIN("|";XX:XX)
Result :
Alternatively we could have use this one-liner (and make some cleanup afterwards) but GoogleSheet returns a blank cell whereas the XPath is perfectly valid :
=IMPORTXML("https://www.powerthesaurus.org/abbreviation/synonyms";"normalize-space(//div[#class='pt-list-terms__container'])")

Keep having errors with importxml + xpath

I spend hours trying to fix this but can't find where the issue is.
I try to import data in google spreadsheet using importxml.
Here is the url :
http://www.journaldesfemmes.com/maman/creches/3-pom/creche-3098
I'm interested in exctracting email and phone number for exemple. I used chrome inspector to copy the Xpath, and few chrome plugins. I guess the issu is the Xpath. Here is the formula I used in spreadsheet :
=importxml("http://www.journaldesfemmes.com/maman/creches/3-pom/creche-3098";"/html/body/div[4]/div/div[1]/div[2]/div[1]/div/div/div/div/div[10]/table/tbody/tr[2]/td[2]")
Hope someone can help
Since the data you want is in tables, it might be easier to use importhtml.
The table you want you can get with this:
=IMPORTHTML("http://www.journaldesfemmes.com/maman/creches/3-pom/creche-3098","table",2)
To get just the phone number add index (row and column of table)
=index(IMPORTHTML("http://www.journaldesfemmes.com/maman/creches/3-pom/creche-3098","table",2),3,2)
email is:
=index(IMPORTHTML("http://www.journaldesfemmes.com/maman/creches/3-pom/creche-3098","table",2),4,2)

Filtering the output for importhtml in Google Sheets

I am building a google sheet to do calculations based on information I found on different websites and stumbled upon the IMPORTHTML function in Google Sheets.
Terrific, I want to import tables and then use some of the values out of those tables to build my sheet and make further calculations.
However, since the function retrieves both the headers and all the information in the table that makes it quite hard to work with. Instead I would like to pull only certain of the data, preferably specific cells in the table pulled.
Is this possible?
For example:
=ImportHtml("http://en.wikipedia.org/wiki/Demographics_of_India"; "table";3)
returns a huge list, what if I would like to pull only the values of B7 and D7? Is that possible? Even filtering out a single row would be useful, whatever that is more feasible. The most important part is that I can get a single row and dont have the full table.
Found the INDEX function, doing exactly what I need it to do!

Resources