Advertisement
DevelopBIR

AutoFollower

Apr 19th, 2017
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.89 KB | None | 0 0
  1. require "watir"
  2. #you would put in your username/password here
  3. username=
  4. password=
  5. #array for followed people
  6. followed= []
  7.  
  8. # Open Browser, Navigate to login page
  9. browser = Watir::Browser.new :chrome
  10. browser.goto 'instagram.com/accounts/login/'
  11.  
  12. # Navigate to username and password fields, inject info
  13. puts "Logging in..."
  14. browser.text_field(:name => "username").set "#{username}"
  15. browser.text_field(:name => "password").set "#{password}"
  16.  
  17. #click the login button
  18. browser.button(:class => "_ah57t _84y62 _i46jh _rmr7s").click
  19. sleep (1)
  20. browser.goto("instagram.com/dvlp.r")
  21. browser.a(:href => '/dvlp.r/followers/').click
  22.  
  23. #this is where I begin to mess up. I want to be able to scroll through users, add them to a list, and then click follow
  24. #only problem is, when you do these steps, instagram has all the followers in a new window. So window.ScrollBy doesnt work.
  25.  
  26.  
  27.  
  28.  
  29. sleep(20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement