Skip to content

Commit

Permalink
Set a user agent, because Morph is being blocked
Browse files Browse the repository at this point in the history
  • Loading branch information
auxesis committed Oct 28, 2016
1 parent 36504f7 commit 2f00ad0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scraper.rb
Expand Up @@ -16,6 +16,7 @@ def scrub(text)

def get(url)
@agent ||= Mechanize.new
@agent.user_agent_alias = 'Windows Firefox'
page = @agent.get(url)
p page.class
p page.header
Expand Down

0 comments on commit 2f00ad0

Please sign in to comment.