Skip to content

Instantly share code, notes, and snippets.

@bartschuller
Created January 17, 2011 22:42
Show Gist options
  • Save bartschuller/783634 to your computer and use it in GitHub Desktop.
Save bartschuller/783634 to your computer and use it in GitHub Desktop.
My new Scala Mechanize library is taking shape
scala> val agent = new org.smop.mechanize.Mechanize
agent: org.smop.mechanize.Mechanize = org.smop.mechanize.Mechanize@612e3937
scala> agent.get("http://www.smop.org/")
res0: org.apache.http.HttpResponse = org.apache.http.message.BasicHttpResponse@3ab5b692
scala> agent.isSuccess
res1: Boolean = true
scala> agent.isHtml
res2: Boolean = true
scala> agent.content
res3: scala.xml.Node =
<html lang="en-US" dir="ltr"><head profile="http://gmpg.org/xfn/11">
<title> Small Matter Of Programming</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"></meta>
<link rel="stylesheet" media="screen" href="http://www.smop.org/wp-content/themes/precious/css/global.css" type="text/css"></link>
<link rel="stylesheet" media="screen" href="http://www.smop.org/wp-content/themes/precious/style.css" type="text/css"></link>
<link rel="stylesheet" media="print" href="http://www.smop.org/wp-content/themes/precious/css/print.css" type="text/css"></link>
<link href="http://www.smop.org/wp-content/themes/precious/gfx/favicon.ico" type="image/x-icon" rel="shortcut icon"></link>
<link href="http://www.smop.org/feed/" title="RSS 2.0" type="a...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment