Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. '''
  2.  
  3. Online Python Compiler.
  4. Code, Compile, Run and Debug python program online.
  5. Write your code in this editor and press "Run" button to execute it.
  6.  
  7. '''
  8.  
  9. from instapy import InstaPy
  10. import os
  11. import sys
  12.  
  13. insta_username = sys.argv[1]
  14. insta_password = sys.argv[2]
  15. selenium_url_var = 'IB_SELENIUM_URL'
  16. selenium_url = os.getenv(selenium_url_var)
  17.  
  18. if not selenium_url:
  19. raise RuntimeError(
  20. 'You must export {} with the url to the selenium server'.format(
  21. selenium_url_var
  22. )
  23. )
  24.  
  25. try {
  26. bot = InstaPy(username=insta_username, password=insta_password,
  27. selenium_local_session=False)
  28. bot.set_selenium_remote_session(selenium_url=selenium_url)
  29. bot.login()
  30.  
  31. if(bot.aborting) {
  32. return 1
  33. }
  34.  
  35. bot.end()
  36.  
  37. return 0
  38.  
  39. } catch (e) {
  40. return 1
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement