Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Instagram Phone Emulation
#1
Hi,

I am using selenium.webdriver to open my companies instagram.

I am having issues with getting a comment to input

import autoit
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.action_chains import ActionChains
username = XXXX
password = XXXX
comment = "awesome!"
getdriver = ("https://www.instagram.com/accounts/login/")

driver = webdriver.Chrome(r'C:\Sol_Drivers\chromedriver_win32\chromedriver.exe')
driver.get(getdriver)

sleep(4)

driver.find_element_by_xpath("//input[@name='username']").send_keys(username)
driver.find_element_by_xpath("//input[@name='password']").send_keys(password)

sleep(4)

driver.find_element_by_xpath("//button[contains(.,'Log In')]").click()

sleep(4)

driver.find_element_by_xpath("//button[contains(.,'Not Now')]").click()

sleep(4)

caption_field = driver.find_element_by_xpath("//textarea[@aria-label='Add a comment…']")
caption_field.send_keys(comment) <Stops working here
The idea is to like add a comment, like a post and move onto the next one.
Any help is appreciated.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Instagram Stories Evil_Patrick 3 43,265 May-31-2022, 12:04 PM
Last Post: RosmenGelik
  Accessing a data-phone tag from an href KatMac 1 2,864 Apr-27-2021, 06:18 PM
Last Post: buran
  Scroll Down Post Instagram Likes rmiguelantunes74 0 3,134 Oct-05-2020, 07:38 PM
Last Post: rmiguelantunes74
  Like ou Unlike Instagram rmiguelantunes74 3 2,512 Jun-14-2020, 08:50 AM
Last Post: rmiguelantunes74
  Instagram Bot _ Posting Comments kristianpython 3 3,277 May-23-2020, 12:54 PM
Last Post: kristianpython
  how to using Mobile Emulation in python selenium abdlwafitahiri 1 2,098 Jan-03-2020, 10:25 AM
Last Post: buran
  Django - Am I in the right direction for creating the models of my Phone Review appli shawnmichaels583583 0 1,805 Oct-15-2019, 06:25 AM
Last Post: shawnmichaels583583
  Login into Instagram using python kingram 1 12,490 Sep-12-2017, 06:34 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020