Pages

Easiest way to Load HTML table in Google spreadsheet

We most of the time try to fetch data from some websites and store in google spread sheet , To do this we spend lots of time to scraping webpages & digging required data in them.

But one of the easiest way to load  HTML table from any webpage to use Google spreadsheet Import feature ( Google is very good at such things !)

To scrap such data I have spent lots of trying writing some scrips in multiple programming languages.But today I am going to tell you easiest way to do it.

Google Docs being able to import tables from websites. And indeed, it has a very useful function called ImportHtml that will scrape a table from a page. Also there are many other options are provided for importing data from live URLs. When you start writing Import... In first cell of your spreadsheet it will show you all options for importing various data as shown below


Importing HTML in Google spreadsheet snap


To extract a table, create a new spreadsheet and enter the following expression in the top left
=ImportHtml(URL, "table", num)
URL here is the URL of the page (between quotation marks), “table” is the element to look for (Google Docs can also import lists), and num is the number of the element (e.g. if there are two tables on same page you can load 2nd table using s as num value), in case there are more on the same page (which is rather common for tables). In our example I am loading table from page "http://www.w3schools.com/html/html_tables.asp".

So I write something like =ImportHtml("http://www.w3schools.com/html/html_tables.asp", "table", 1)  and hit enter to import data.




Once this is done, Google Docs retrieves the data and inserts it into the spreadsheet, including the headers. The last step is to download the spreadsheet as a CSV file.



This is very simple and quick, and a much better idea than writing a custom script. Of course, the real solution would be to offer all data as a CSV file in addition to the table to begin with. But until that happens, we will need tools like this to get the data into a format that is actually useful.

You can follow THIS to know more.

Integrating Static Library written in Objective C to Swift iOS Project

I was looking for integrating my one of the Static library written in Objective-C into new swift project  & you know what I got very little information on it. I struggled alot to make my things working with Objc+swift integration for my project.

Here I will guide you through such integration

1. Suppose you have some static Library XYZ written in Objective-C

Add that library as subproject into your target project as descried HERE

Then we have to create Bridge-header which will make swift code to access Objective C part of your library.

You can just follow
Xocde -> New -> File
there you need to add header file (from iOS/OS X section)
be carefull whilte naming this file. this file should have name like


<product_module_name>-Bridging-Header.h : Default Product module name is project name itself.

you can read more about "Product module name" at Apple Docs


Now add import statements in <product_module_name>-Bridging-Header.h for accessing Native SDK Classes


e.g.

If you have Project with name "sampleSwift" then your bridge file should look like


Background Pattern image to SKScene

Today we are going to see how we can add background pattern image to SKScene

Once, there was  requirement for one of project to set pattern image for SKScene background I tried with backgroundColor property of SKScene like


But it won't work.

So I wrote category to overcome this. Using this category of SKScene you can easily set background  pattern to SKScene without any pain.