I'm trying to extract a cell value from a Google spreadsheet using imacro script.
This is the spread sheet I'm working on.
And I need to get the Cell 'A1' value.
Below is my try, and it is not working.
TAG POS=2 TYPE=A ATTR=TXT:https://www.ebay.com* EXTRACT=TXT
Please help.
One of the possible (simplest) ways is to use Google Query Language for requesting necessary data and extract them afterwards. Something like this:
URL GOTO=https://docs.google.com/spreadsheets/d/13akuXU0cp047_6VFdtUgdn2fKfhPilF_hPHrnTNV164/gviz/tq?tqx=out:html&tq=select%20A%20limit%201
TAG XPATH="//tr[last()]/td" EXTRACT=TXT
Keep in mind that your spreadsheet must be shared in this case.
Related
I am making a calculator in Google sheets and I would like to find a formula or script or something that will allow me to read the value of a certain square and add the formula "=sum(C5:C9)" or "=product(C5:C9)" or whichever depending on what the person puts in C4. Not sure if this is possible in google sheets (without custom code), but if it is, that would be great!
try:
=IF(C4="*"; PRODUCT(C5:C9); SUM(C5:C9))
I'm having a tough time pulling info in on Google Sheets using the ImportXML function. I want to pull in the price of a crypto coin so that I have a real-time feed. The link that I'm hoping to pull from is:
https://www.dextools.io/app/uniswap/pair-explorer/0x40f0e70a7d565985b967bcdb0ba5801994fc2e80
I've tried out a lot of different formulas and keep getting an #N/A or an error. Some of the ones I've tried:
Copy XPATH fully:
=IMPORTXML("https://www.dextools.io/app/uniswap/pair-explorer/0x40f0e70a7d565985b967bcdb0ba5801994fc2e80","/html/body/app-root/div[3]/div/main/app-uniswap/div/app-pairexplorer/app-layout/div/div/div[2]/div[2]/ul/li[2]/span")
Shortened XPATH (also tried deleting the second backslash before 'li' but that didn't work):
=IMPORTXML("https://www.dextools.io/app/uniswap/pair-explorer/0x40f0e70a7d565985b967bcdb0ba5801994fc2e80","//li[2]/span")
Include class:
=IMPORTXML("https://www.dextools.io/app/uniswap/pair-explorer/0x40f0e70a7d565985b967bcdb0ba5801994fc2e80","//li[2]/span[#class='ng-tns-c93-2 ng-star-inserted']")
Does anyone have thoughts? Thanks!
upon disabling JavaScript the site is empty = can't be scraped by Google Sheets by any import formula.
To avoid the problem above, consider using a proper API service that gives you easy access to the data.
For instance you could get Zero price in USD using
=IMPORTDATA("https://cryptoprices.cc/ZERO/")
If you need it in comparison to ETH you could try doing it by hand
=IMPORTDATA("https://cryptoprices.cc/ZERO/")/=IMPORTDATA("https://cryptoprices.cc/ETH/")
Or use a more advanced API such as CoinGecko's
https://www.coingecko.com/en/api
I have a Google sheet the references values from another and using conditional formatting, it marks down the cells with the same value. Within the same document, I use the following code:
=countif(indirect("Responses!D2:D103"),A1)=1 That works great.
However, I try to get the same result referencing the same sheet from an external spreadsheet to no avail. I feel like I tried all the combinations of IMPORTRANGE and INDIRECT out there, similar to this: =countif(importrange("sheet_url",indirect("Responses!$D$2:$D$103")),A1)=1
I'm sure I'm missing some small detail, I just can't tell what it is.
try:
=INDEX(COUNTIF(IMPORTRANGE("1ddqnVB9eDkk2tCadotN0NQlZdJDzIX4UyEEuXVs99nk",
"Responses!D1:D103"), A1)=1)
note that access needs to be granted first in order for this to work
This URL: https://www.screwfix.com/p/makita-jr3050t-2-1010w-reciprocating-saw-240v/27338
Trying to use IMPORTXML on google Sheets to pull in the price (119.99 as of today)
Using the following formula:
(via Google Developer Tab, right-click Copy XPath)
=IMPORTXML(https://www.screwfix.com/p/makita-jr3050t-2-1010w-reciprocating-saw-240v/27338, "//*[#id='product_price']/text()")
Or
=IMPORTXML("https://www.screwfix.com/p/makita-jr3050t-2-1010w-reciprocating-saw-240v/27338","//meta[#itemprop='price']/#content")
Or
=importxml(https://www.screwfix.com/p/makita-jr3050t-2-1010w-reciprocating-saw-240v/27338, "//div[#class='pr__price']")
Plus a few other variations - Unfortunatley, they all come out as #N/A
Can anyone help me find the correct path?
It seems that in this case, when the URL is retrieved by IMPORTXML(), most values are included in head. When I tried this URL, body retrieved by IMPORTXML() was empty. So how about this workaround?
=REGEXEXTRACT(IMPORTXML(A1,"//head/*"),"(\d.+)INC")
Please put the URL of https://www.screwfix.com/p/makita-jr3050t-2-1010w-reciprocating-saw-240v/27338 to the cell "A1" and put the formula to other cell.
In this workaround, the value you want is retrieved from the values retrieved from head.
Result:
Note:
I'm not sure whether this formula can be used for other URL. If you want to use this for other URL, please confirm the values and set the xpath and regex.
If you use Google Apps Script, I think that the value can be retrieved from the body of URL.
If this was not what you want, I'm sorry.
I have a main sheet in witch I copy it and create different versions, kind of like simulating different results.
But every time I want to change something in the main sheet, I have to go in all the other sheets I created and changed.
I don't know if it is possible, but the best way for me would be to create a formula like this:
copyFormula(Sheet1!V2) -> And bringed the exactly same result as if I had gone to Sheet1 copied V2 and pasted it this cell.
I tried to create this formula but failed consistently.
Thanks!!
What you need to do is to manipulate the properties of the sheets.
Here is a reference where you can create those actions.
The Sheets API allows you to create sheets, delete sheets, and control
their properties. The examples on this page illustrate how some common
sheet operations can be achieved with the API.
In these examples, the placeholders spreadsheetId and sheetId are
used to indicate where you would provide those IDs. The spreadsheet
ID can be discovered from the spreadsheet URL; the sheet ID can be
obtained from the spreadsheet.get method.
You can refer to this documentation on how you can read the formula you are needing in the entire sheets.
The Sheets API allows you to read values from cells, ranges, sets of
ranges and entire sheets. The examples on this page illustrate how
some common read operations can be achieved with the
spreadsheets.values collection of this API. You can also read
cell values using the spreadsheets.get method, but in most cases
using spreadsheets.values.get or
spreadsheets.values.batchGet is easier to use.