Guest User

Untitled

a guest
Apr 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class AbstractScraper
  2. def initialize
  3. @agent = WWW::Mechanize.new
  4. @agent.user_agent_alias = "Windows Mozilla"
  5. @agent.keep_alive = false
  6. end
  7. end
  8.  
  9. class AuthenticatedScraper < AbstractScraper
  10. def initialize(username, password)
  11. super()
  12. login(username, password)
  13. end
  14. end
  15.  
  16. class NormalAScraper < AbstractScraper; end
  17. class NormalBScraper < AbstractScraper; end
  18.  
  19. class GoofyScraper < AuthenticatedScraper
  20. def initialize
  21. super()
  22. login # apparently login takes *args?
  23. end
  24. end
Add Comment
Please, Sign In to add comment