IMPORTXML- Can not fetch data table in URL (google sheet) - google-sheets-formula

I have problem with IMPORTXML to google sheet with link below.
URL: https://bscscan.com/token/generic-tokentxns2?m=normal&contractAddress=0xa260E12d2B924cb899AE80BB58123ac3fEE1E2F0&a=0x99c1c5b6771dd96291a18d96225cdf67d3b6489a&sid=47fdfe5f7b0891220ab647e32b1a8527&p=1
My script.
IMPORTXML(URL, "table", 1)
IMPORTXML(URL, "//tr", 1)
Dont work? Any one help me get table data for the link above.
Thanks
I try many functions but all fails. like: //tr/td or //table/td. they dont get any data.

Related

Power Query in Excel - web scraping

I am trying to use the Power Query in Excel to scrape information from below website. However, it didn't work well - no text or table return at the end. Can someone please advise? Thank you in advance.
Here are the step that I want to automate:
search the product with code 7515 (here I think I can tweak the url to get step 2)
CIBC structured notes website
click on the product name with the same CBL code
search result about code 7515
the circled one is the info that I want to obtain
desired structured note info

Import table using IMPORTXML

I am trying to pull the table from https://rotogrinders.com/schedules/nfl into Google Sheets
I tried using ImportHTML("https://rotogrinders.com/schedules/nfl", "table", 1) but it just returns the header:
Time Team Opponent Line Moneyline Over/Under Projected Points Projected Points Change
Using ImportXML, I tried IMportXML("https://rotogrinders.com/schedules/nfl","//tr"), but it returns the same header and no data.
I dont think the tbody needs authentication to access. I logged out, cleared my cache and even tried on another computer and still no tbody.
I know its a table called "tschedules", but cant get the data
Is there another part of the XPATH I am missing?
This is the XPATH from google scraper: "//table[1]/tbody/tr[td]"
When you load this website the actual table doesn't load in for a few seconds. This is why you're not seeing any data come in. If you can set some wait time on that import call somehow then it would work.

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)

Google ImportXML to Scrape Prices off TIAA.org

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()")

Extract href in table with importxml in Google spreadsheet

I am trying to pull the href for each row of each table from this website:
http://www.epa.gov/region4/superfund/sites/sites.html#KY
I can pull the table information off using =IMPORTHTML(A1,"table",1) for all 7 tables, but I need the href to the site with the detailed information.
Using =IMPORTxml(A1,"//div[#class='box']") I can pull the information needed from a site like:
http://www.epa.gov/region4/superfund/sites/fedfacs/alarmyaplal.html
but I need to extract the fedfacs/alarmyaplal.html portion for each row on the original page.
I've tried using //#href, but it is not returning any results. I'm thinking it is because the data is structured in a table but I'm stuck on where to go from here.
I'm not sure about any of the Google Spreadsheet functionality, but here's an XPath to select all href attributes of the Kentucky sites (since your first link included the 'ky' anchor):
//body//a[#id='ky']/following-sibling::table[1]/tbody/tr/td[1]/strong/a/#href
This is very specific to the Kentucky table: following-sibling::table[1] means the first table node after, and at the same level of, a[#id='ky'].

Resources