Demonstrations: Make a Helena Program
Explore your webpagesWhen you want to make a Helena program, first pick the website or websites from which you'll collect data. Look around the webpages you'll use so that you know where your information is located. For this tutorial, you'll be extracting data from http://helena-lang.org/sample-data, so take a moment to play around with that page and its links. Go ahead and copy the start URL - you'll want to have it ready when you start a demonstration. And remember, once you're doing a demonstration, everything that you do during the recording is also going to be done by your program; so now's the time to do any stray clicks, follow stray links, and generally figure out where your data lives.
Decide what data you wantNext decide what you want to include in your dataset - you should know exactly how your target dataset should look. Let's say we want to collect the following table:
|Buffy the Vampire Slayer||Awesome!|
|Angel||Not So Awesome|
Open the extensionLet's figure out how we demonstrate with Helena. We'll start by exploring the interface. We open the extension by clicking on the icon at the upper right. This opens the control panel:
Start RecordingNext we'll start recording. When we click the "Start Recording" button, a new window appears at the right of the current location of the control panel. This is the recoding window. Everything that we want to have recorded needs to happen in this window, because Helena isn't paying attention to any of the other Chrome windows we might have open. We recommend keeping both the control panel and the recording window visible throughout recording so that Helena can give you feedback about the data you're collecting.
Load the first page you'll useWhen you make a demonstration, your job is to show Helena how you'd collect the first row of the dataset you want. We already decided that our first row is the title and subjective rating of the first show in our list, so "Scandal" and "Awesome!" from http://helena-lang.org/sample-data. So the first thing we'll do is paste that URL that we copied earlier into the URL bar of the recording window.
Figure out what you can scrapeWhen you're doing a Helena demonstration, you can interact with the browser as usual, but you can do a couple new things as well. In the control pane, you'll see directions for how to collect data from webpages, and they'll include a keyboard shortcut you can use. The particular shortcut varies based on what operating system you're using, but usually it's just the ALT key, so we'll just talk about using the ALT key, and you can look at the instructions if that isn't working for you. During a demonstration, when you hold down the ALT key, you'll see a red highlight following your mouse around when you mouse over webpages in the recording window; this red highlight lets you know which webpage elements