mechanize.cr/main.cr

10 lines
257 B
Crystal
Raw Normal View History

2021-04-30 14:37:41 +02:00
require "./src/mechanize.cr"
agent = Mechanize.new
2021-05-01 16:22:37 +02:00
agent.request_headers = HTTP::Headers{"Foo" => "Bar"}
2021-05-02 14:13:20 +02:00
params = {"hoge" => "hoge"}
page = agent.get("http://example.com/", params: params)
2021-05-04 06:42:58 +02:00
puts page.code
puts page.body
puts page.css("h1").first.inner_text