"git selenium projeccts instagram" Code Answer's

You're definitely familiar with the best coding language TypeScript that developers use to develop their projects and they get all their queries like "git selenium projeccts instagram" answered properly. Developers are finding an appropriate answer about git selenium projeccts instagram related to the TypeScript coding language. By visiting this online portal developers get answers concerning TypeScript codes question like git selenium projeccts instagram. Enter your desired code related query in the search bar and get every piece of information about TypeScript code related question on git selenium projeccts instagram. 

git selenium projeccts instagram

By Lucky LarkLucky Lark on Jul 24, 2020
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from re import sub
from decimal import Decimal

class Instabot:
    def __init__(self,username,password,OtherUserId):
        self.driver=webdriver.Chrome("/Users/Aleti Sunil/Downloads/chromedriver_win32/chromedriver.exe")
        self.driver.maximize_window()
        self.driver.get("https://www.instagram.com/")
        sleep(2)
        self.driver.find_element_by_xpath("//input[@name=\"username\"]").send_keys(username)
        self.driver.find_element_by_xpath("//input[@name=\"password\"]").send_keys(password)
        self.driver.find_element_by_xpath("//button[@type=\"submit\"]").click()
        sleep(10)
        self.driver.find_element_by_xpath("//button[text()='Not Now']").click()
        sleep(5)
        self.driver.get("https://www.instagram.com/"+OtherUserId)
        posts = self.driver.find_element_by_xpath("/html/body/div/section/main/div/header/section/ul/li/span/span").text
        posts = Decimal(sub(r'[^\d.]', '', posts))
        print(posts)
        pic = self.driver.find_element_by_class_name("_9AhH0")    
        pic.click()
        sleep(2)
        like = self.driver.find_element_by_xpath('/html/body/div[4]/div[2]/div/article/div[2]/section[1]/span[1]/button')
        like.click()
        nextPic = self.driver.find_element_by_xpath('/html/body/div[4]/div[1]/div/div/a')
        nextPic.click()
        print("success")
        sleep(2)
        for i in range(int(posts-1)):
            like = self.driver.find_element_by_xpath('/html/body/div[4]/div[2]/div/article/div[2]/section[1]/span[1]/button')
            sleep(2)
            like.click()
            sleep(2)
            nextPic = self.driver.find_element_by_xpath('/html/body/div[4]/div[1]/div/div/a[2]')
            nextPic.click() 
            sleep(2)
    sleep(20)
Instabot('abcxcwe','dfasd32963','capdt') #Username,password,Username of other person

Source: dev.to

Add Comment

0

All those coders who are working on the TypeScript based application and are stuck on git selenium projeccts instagram can get a collection of related answers to their query. Programmers need to enter their query on git selenium projeccts instagram related to TypeScript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about git selenium projeccts instagram for the programmers working on TypeScript code while coding their module. Coders are also allowed to rectify already present answers of git selenium projeccts instagram while working on the TypeScript language code. Developers can add up suggestions if they deem fit any other answer relating to "git selenium projeccts instagram". Visit this developer's friendly online web community, CodeProZone, and get your queries like git selenium projeccts instagram resolved professionally and stay updated to the latest TypeScript updates. 

TypeScript answers related to "git selenium projeccts instagram"

View All TypeScript queries

TypeScript queries related to "git selenium projeccts instagram"

Browse Other Code Languages

CodeProZone