Skip to content

Instantly share code, notes, and snippets.

@marklocklear
Created December 1, 2010 13:59
Show Gist options
  • Save marklocklear/723507 to your computer and use it in GitHub Desktop.
Save marklocklear/723507 to your computer and use it in GitHub Desktop.
require 'java'
#HTMLUNIT 2.8 jar files
require 'lib/apache-mime4j-0.6.jar'
require 'lib/commons-codec-1.4.jar'
require 'lib/commons-collections-3.2.1.jar'
require 'lib/commons-io-1.4.jar'
require 'lib/commons-lang-2.4.jar'
require 'lib/commons-logging-1.1.1.jar'
require 'lib/cssparser-0.9.5.jar'
require 'lib/htmlunit-2.8.jar'
require 'lib/htmlunit-core-js-2.8.jar'
require 'lib/httpclient-4.0.1.jar'
require 'lib/httpcore-4.0.1.jar'
require 'lib/httpmime-4.0.1.jar'
require 'lib/nekohtml-1.9.14.jar'
require 'lib/sac-1.3.jar'
require 'lib/serializer-2.7.1.jar'
require 'lib/xalan-2.7.1.jar'
require 'lib/xercesImpl-2.9.1.jar'
require 'lib/xml-apis-1.3.04.jar'
#Web Client Class
include_class 'com.gargoylesoftware.htmlunit.WebClient'
include_class 'com.gargoylesoftware.htmlunit.BrowserVersion'
include_class 'com.gargoylesoftware.htmlunit.SilentCssErrorHandler'
# HTMLUnit is insanely verbose by default. We're turning off the warnings
[ 'com.gargoylesoftware.htmlunit',
'com.gargoylesoftware.htmlunit.html',
'com.gargoylesoftware.htmlunit.javascript',
'org.apache.commons.httpclient'
].each { |package| java.util.logging.Logger.getLogger(package).level = java.util.logging.Level::OFF }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment