Code: Alles auswählen
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time
class Instabot():
def __init__(self, username, password):
self.username = username
self.password = password
self.browser = webdriver.Chrome("./chromedriver.exe")
def WaitForObject(self, type, string):
return WebDriverWait(self.browser,3).until(EC.presence_of_element_located((type,string)))
def WaitForObjects(self, type, string):
return WebDriverWait(self.browser,3).until(EC.presence_of_all_elements_located((type,string)))
def login(self):
self.browser.get("https://www.Instagram.com/")
Logbut = self.WaitForObject(By.CSS_SELECTOR,"button.primary.actionLogin").click
def main():
bot =Instabot("TEST", "TEST")
bot.login()
if __name__ == "__main__":
main()