Skip to content

Commit

Permalink
test a request to a server I control, to see what morph is doing to t…
Browse files Browse the repository at this point in the history
…he request
  • Loading branch information
auxesis committed Oct 28, 2016
1 parent 2f00ad0 commit b2dff5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scraper.rb
Expand Up @@ -16,14 +16,16 @@ def scrub(text)

def get(url)
@agent ||= Mechanize.new
@agent.user_agent_alias = 'Windows Firefox'
# @agent.user_agent_alias = 'Windows Firefox'
page = @agent.get(url)
p page.class
p page.header
puts page.content
page
end

get('http://l.fractio.nl/request_from_morph')

# This attemps to solve a complicated problem where the information is spread
# across multiple elements. This finds all the elements until the next "header"
# (a strong element), then converts them all to text.
Expand Down

0 comments on commit b2dff5f

Please sign in to comment.