Hot answers tagged

5

You can use built-in IMPORTXML function which imports data from a table or list within an HTML page. Here is the example: =IMPORTXML("http://www.google.com","//title") Some examples with similar meta tags: =IMPORTXML("http://www.google.com","//meta[@name='description']/@content") =IMPORTXML("http://www.google.com","//meta[@name='keywords']/@content")


3

It's because of <tbody>. There is no <tbody> in the HTML source. Browser puts it there (on its own; nothing to do with JavaScript on the page) because it believes it should be there, according to HTML spec. Just remove /tbody from the path: =IMPORTXML( "https://eresearch.fidelity.com/eresearch/evaluate/fundamentals/keyStatistics.jhtml?...


2

Based on Normal Human's answer, I've created a Google sheets script that will parse and email IFTTT based on a price threshold. Google sheet cells won't update ImportXml() or other external site data more than once every hour or so, even using workarounds. However, accessing external sites via the script works. Use the following script and set up a ...


2

My suggestion: Create a Google Spreadsheet with either ImportData (for CSV), ImportXML (for XML) or ImportFeed (for RSS/Atom). There is a trick to make it update more often than the Google default (whatever it is). Have a Google Apps script comparing the data in a particular cell to a given threshold. It can run every hour, and send an email when needed....


2

The command IMPORTXML ignores the nodes with no text content: for example, taking //div[3] from the document where the body consists of <div>First</div> <div>Second</div> <div></div> <div>Fourth</div> results in "Fourth". So, when you count the <div> elements, skip over those where there is no text. ...


2

The error in your importxml was in the xpath syntax. here is the correct one: =CONCATENATE(IMPORTXML("http://www.walmart.com/ip/Morton-Sea-Salt-Fine-Salt-17.6-oz/10849552","//*[@itemprop='price'][1]")) edited: added the [1] at the end of the xpath to prevent the duplicate price.


2

It's not possible to achieve the desired result by using IMPORTXML alone, I think. Instead use Google Apps Script and the XML Service Service. Example: Adaptation of the code taken from the answer by Vidar S. Ramdal function parseFeedXml(url) { var result = []; var xml = UrlFetchApp.fetch(url).getContentText(); var document = XmlService.parse(...


1

Short answer AFAIK, regarding XPath queries to be used with IMPORTXML there isn't straightforward method as XPath 1.0 support looks that was not fully implemented and the web pages developers could follow the practices to set the structure of their webpages. Explanation While the use of tools like Chrome Developer Tools or browser extensions/add-ons could ...


1

Use COUNTA and ARRAY_CONSTRAIN to set the size of the sequential number array to be used as the sort column. Example: =ARRAYFORMULA(ARRAY_CONSTRAIN(ROW(A:A),COUNTA(IMPORTXML(range,xpath)),1)) The final formula should look like the following: =ARRAYFORMULA( ARRAY_CONSTRAIN( SORT( { IMPORTXML(url,xpath), ARRAY_CONSTRAIN(...


1

Short answer =TRANSPOSE( QUERY( TRANSPOSE( IMPORTXML( "http://chat.stackexchange.com/transcript/7/2015/8/13", "//div[@class='content']" ) ), , 1000 ) ) Explanation IMPORTXML is returning an array having one column by each inner span tag. There is one span tag by each smart link included in the chat ...


1

Something went wrong on Google's side, apparently. Other stock symbols import correctly. My uneducated guess is that there was a transmission error and a corrupted fetch result got stuck in Google's cache. I was able to break the cache by adding a redundant URL parameter: http://www.bloomberg.com/quote/7501:JP?param=1 fetched correctly. By the way, the ...


1

Not every webpage can be scraped with importXML. There are several possible issues: Some content on the page may be generated with JavaScript, which is not executed by importXML. The page may be invalid as XML file. A typical HTML page is invalid XML (unless it is an XTHML page). The parser of importXML tries to sort things out, but in the presence of a ...


1

Ultimately, I can't do it with Google's functions. As a result, I decided to write a custom function. Go to Tools -> Script Editor. Click "Spreadsheet" on the left hand side to create a new document. Scroll down and paste the following code in: function getWalmartPrice(url) { var html = UrlFetchApp.fetch(url).getContentText(); //Can't create document ...


1

I have a feed setup that posts to tumblr and I've never had issues with spacing. Looking at it seems to be that the <p> and <br \> tags are respected by ifttt. Here's snippet (note, it's a vent anonymously site so I'm trying to find a safe one). This is from the <content:encoded> section of a wordpress xml feed <content:encoded> ...


1

The categorized RSS feed links might differ from site to site, CMS to CMS. For the given website, I did a quick google search for filetype:xml site:atvn.org(click it). It seems they have feed links like this - www.atvn.org/alumni/rss.xml www.atvn.org/blogs/rss.xml www.atvn.org/user/rss.xml www.atvn.org/news/2012/rss.xml etc. From the search results, ...


1

From: How to export Google search results You could try using Google AJAX Search API. For example querying the URL http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Svick will give you results for my username in JSON. But it is deprecated http://code.google.com/apis/websearch


1

Do you have to use Google? I've read very good things about Yahoo's BOSS. And it provides the simple output (XML) you need.



Only top voted, non community-wiki answers of a minimum length are eligible