Skip to content

Instantly share code, notes, and snippets.

View valo's full-sized avatar
👷‍♂️
buidling

Valentin Mihov valo

👷‍♂️
buidling
View GitHub Profile
curl http://europe.wsj.com/home-page > wsj.html
curl --data-binary @wsj.html g.pdfgenapp.com > wsj.pdf
@valo
valo / env.rb
Created October 20, 2009 17:19
require 'spec/expectations'
require 'webrat'
Webrat.configure do |config|
config.mode = :mechanize
end
class MechanizeWorld < Webrat::MechanizeAdapter
end
require 'rubygems'
require 'mechanize'
require 'tidied_html_page.rb'
a = WWW::Mechanize.new do |agent|
agent.user_agent_alias = 'Mac Safari'
agent.log = Logger.new(File.open('parser.log', 'w+'))
agent.pluggable_parser.html = TidiedHTMLPage
agent.pluggable_parser.xhtml = TidiedHTMLPage
end