trying to login instagram from chrome but its instantly closes the window here is the code
url = "https://www.instagram.com"
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
import time
from bs4 import BeautifulSoup
driver = webdriver.Chrome()
driver.get(url)
driver.maximize_window
click_button = driver.find_element(value="a9-- _ap36 _a9_0")
click_button.click
time.sleep(2000)
2
-
Maximize Window: You need to call the maximize_window method correctly.
# Maximize the browser window driver.maximize_window()
-
Element Selector: The find_element method should specify the By strategy.
# Find the login button (update the selector as needed) click_button = driver.find_element(By.CLASS_NAME, "a9-- _ap36 _a9_0")
-
Click Method: You need to call the click method correctly.
# Click the login button click_button.click()
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.