LaVOZs

The World’s Largest Online Community for Developers

'; python - Can't start a ig comment bot - LavOzs.Com

I've been trying to create an automatic comment tool for Instagram in python. When executing the code I get the message in the browser "It was not possible to comment"

How to fix?

def comment(self, commentary, amount):
    """
    Commenting on a publication. 
    Receives as parameters the commentary content (commentary)
    And how many comments it will make (amount)
    """
    number = 0
    while number < amount:
        self.driver.find_element_by_xpath("/html/body/div[4]/div[2]/div/article/div[2]/section[3]/div/form/textarea")\
            .send_keys(commentary)
        self.driver.find_element_by_xpath("/html/body/div[4]/div[2]/div/article/div[2]/section[3]/div/form/button")\
            .click()
        number += 1
        sleep(10)
Related
Multiple line code example in Javadoc comment
Why can't Python parse this JSON data?
Is there a way to create multiline comments in Python?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)
Pls how to access message in span tag
HTML 5 Favicon - Support?
Expand page set html and css
Create a hyperlink automatically asp.net
Getting a “NoSuchElementException” when I tried to include HTML details of a login button when building a bot
StaleElementReferenceException when I try to click the “n others” in “Liked by someone and n others” of an Instagram post, using Selenium and Python