Web Scraping with AutoHotKey 103-Leveraging the Document Object Model

Web Scraping with AutoHotKey

Web Scraping with AutoHotKey-Leveraging the Document Object Model

This third video on Web Scraping gets a little advanced and shows how you can leverage the DOM to make extracting data from a webpage much easier and reliable.

Leveraging the Document Object Model (DOM)will take some practice (especially if you’re not familiar with Object oriented coding) but it is well worth it because it greatly reduces the amount of clean-up you have to do after you extract your data.  I used to write some pretty crazy regular expressions to try and clean up my code.  Once I learned how to better navigate the DOM it negated the need for cleaning!

The HTML Document Object Model (DOM)-Tree of Objects

Document Object Model

Video Web Scraping with AutoHotKey Leveraging the DOM plus looping over pages

The syntax for writing the writing the web scraping code can be found on my first post here.  There is also an AutoHotKey forum thread you might wish to review here.

How to Customize SciTE Status bar: Create your own to your liking with this simple hack

scite status barHere I show you how to customize SciTE status bar.  This  is a great, easy, way to add more relevant information to your needs.

In the below video I walk through how you can make minor tweaks to your status bar by editing your user.properties file.  Further down the page I’ve provided some of the built-in variables however there are a ton of additional ones you can check out the defined variables here.

Here is the syntax I walked through in the below video.  The first SciTE statusbar.text.1 that is commented out is one I use by default.

SciTE4AutoHotkey Status Bar customization video

Built-in variables for SciTE status bar

Variable NameMeaning
FilePathfull path of the current file
FileDirdirectory of the current file without a trailing slash
FileNamebase name of the current file
FileExtextension of the current file
FileNameExt$(FileName).$(FileExt)
Languagename of the lexer used for the current file
SessionPathfull path of the current session
CurrentSelectionvalue of the currently selected text
CurrentWordvalue of word which the caret is within or near
Replacementsnumber of replacements made by last Replace command
SelectionStartColumncolumn where selection starts
SelectionStartLineline where selection starts
SelectionEndColumncolumn where selection ends
SelectionEndLineline where selection ends
CurrentMessagemost recently selected output pane message
SciteDefaultHomedirectory in which the Global Options file is found
SciteUserHomedirectory in which the User Options file is found
SciteDirectoryHomedirectory in which the Directory Options file is found
APIPathlist of full paths of API files from api.filepattern
AbbrevPathfull path of abbreviations file
ScaleFactorthe screen’s scaling factor with a default value of 100

How to create your own Custom SciTE Hotkeys by hacking your SciTE user.properties file

Custom SciTE Hotkeys

Creating custom SciTE Hotkeys are a great way to speed-up working in SciTE!

I highly recommend you download and print out these built-in SciTE4AutoHotkey hotkeys

Hotkeys are a great way to be more efficient!  AutoHotkey makes it easy to create a hotkey for nearly anything however you can easily create your own custom SciTE Hotkeys by making a tweak to your user.properties file.

Below is the text I have in my user.properties file which builds in hotkeys without needing AutoHotkey.  You can find additional commands by going here.  Just don’t forget you are not limited to these.  In the video I show how you can create your own!  Make sure you do not have any comments within your list.  In my video I have them but I realized, later, that this causes issues.

btw- To be able to highlight text and move it up or down you can add
Ctrl+Shift+Up|2620|\
Ctrl+Shift+Down|2621|\

This video walks through creating your own Custom SciTE Hotkeys