[Tutorials] How to parse a web page, and retrieve the data you want

electron

Administrator
Staff member
By popular request, I decided to write a small tutorial on how to parse a webpage (also known as screen scraping), and grab the data you are looking for. The example is a script for the Homeseer automation software, and uses the hs.GetUrl function, but it's written in VBscript, and many of these functions can be found in other languages too, so this is a great start, no matter what language you want to use.

In this example, I am going to grab the data from http://www.randomjoke.com/topic/oneliners.php which shows a random one-liner/joke every time you load the page. The functions I used for this page are also the ones you would use when parsing other websites. Everyone has their own "coding" style, so there are different (and more efficient) ways of doing the same thing, but I am trying to keep things easy here.

Click here to view the article
 
Back
Top