I can't locate my "coreSpriteRightPaginationArrow" This code used to work earlier but I don't know what's the problem. It is impossible to click on the right arrow button. Here is my code :
from random import randint
from selenium.webdriver.common.keys import Keys
import time
import instapy
from selenium import webdriver
driver = webdriver.Firefox()
class InstagramBot:
def __init__(self,username,password):
self.username = username
self.password = password
self.bot = webdriver.Firefox()
def login(self):
bot = self.bot
bot.get('https://www.instagram.com/accounts/login/')
time.sleep(randint(2, 6))
email = bot.find_element_by_name('username').send_keys(self.username)
password = bot.find_element_by_name('password').send_keys(self.password + Keys.RETURN)
time.sleep(randint(5,6))
bot.find_element_by_xpath("//*[@id='react-root']/section/main/div/div/div/div/button").click()
def searchHashtag(self,hashtag):
bot = self.bot
bot.get('https://www.instagram.com/explore/tags/' + hashtag)
def likePhotos(self,amount):
bot = self.bot
bot.find_element_by_class_name('v1Nh3').click()
i = 1
while i <= amount:
try:
time.sleep(randint(2, 6))
bot.find_elements_by_class_name("_8-yf5").click()
time.sleep(randint(2, 6))
i += 1
except:
bot.find_element_by_class_name('coreSpriteRightPaginationArrow').click()
continue
I hope you can find the problem. Thank you!