title: Numpy Ndarray has no object attribute as open
body: <p>I am working an automation program of web-scrapping.
  I have been using geeks for geeks for program for downloading Instagram posts of a particular user.
  I had to do some changes in the code as it was outdated and also according to my needs.
  Instead of directly downloading and saving in particular folder I had to take screen shot of the post, crop it and save it somewhere.
  The program is working fine till the screenshot thing comes in.</p>
  <pre><code>print(&quot;Importing Modules&quot;)
  #! ---Modules--- 
  
  #! -------Communicating With the System-------
  
  import os
  
  #! -------Workking With the Files-------
  
  import cv2
  
  #! -------Virtual Clock-------
  
  import time
  
  #! -------Taking ScrenShot-------
  
  import pyautogui
  
  #! -------Working With Instagram-------
  
  import instaloader
  
  #! -------Array Maintannce-------
  
  import numpy as np
  
  #! -------Data Processing-------
  
  import pandas as pd
  
  #! -------Web Services-------
  
  from bs4 import BeautifulSoup as bs
  
  #! -------PPt Automation-------
  
  from pptx import Presentation
  
  #! -------Web Automation -------
  
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  #! -------Unit Measurement-------
  
  from pptx.util import Inches, Pt
  
  #! -------Webdriver Chrome Extension -------
  
  from webdriver_manager.chrome import ChromeDriverManager
  
  print(&quot;Modules Imported&quot;)
  
  #! ---Varibales---
  
  print(&quot;Assigning Variables&quot;)
  
  #! --------Target-------- 
  
  target = input('Enter User Name Of User For Downloading Posts : ')
  #user = input(&quot;Enter the user : &quot;)
  
  #! --------URL--------
  
  url = 'https://instagram.com/'+ target
  
  #! --------Content--------
  
  #content = input(&quot;Enter the information : &quot;)
  
  #! --------Dimensions--------
  
  top = 400
  left = 100
  right = 600
  bottom = 800
  
  #! --------Path--------
  
  path = r&quot;C:\Users\user\Desktop\VS CODE\Programs\Automation\Python\PRO_1,&quot; + target+ &quot;\target.png&quot;
  
  scrapper = instaloader.Instaloader()
  scrapper.download_profile(target, profile_pic_only = True)
  
  #! -------Picture Values-------
  
  picture_0 = 'Picture_0.jpg'
  picture_1 = 'Picture_1.jpg'
  picture_2 = 'Picture_2.png'
  picture_3 = 'Picture_3.png'
  picture_4 = 'Picture_4.png'
  picture_5 = 'Picture_5.png'
  picture_6 = 'Picture_6.png'
  picture_7 = 'Picture_7.png'
  
  print(&quot;Variables Assigned&quot;)
  
  #! ---Functions--- 
  
  #! Chrome Opening 
  
  def open_chrome():
      
      global chrome
      
      print(&quot;Opeining CMD&quot;)
      chrome = webdriver.Chrome(ChromeDriverManager().install())
      print(&quot;Opening Chrome&quot;)
  
  #! Entering URL
      
  def url_name(url):
      
      print(&quot;Entering the Url&quot;) 
      chrome.get(url)
      time.sleep(4)
  
  #! Entering Login Information
  
  def login():
      
      log_but = chrome.find_element_by_class_name(&quot;_acap&quot;)
      print(&quot;Finding the Login Button&quot;)
      time.sleep(2)
      log_but.click()
      print(&quot;Clicking the Login Button&quot;)
      time.sleep(4)
      usern = chrome.find_element_by_name(&quot;username&quot;)
      print(&quot;Finding the Username&quot;)
      usern.send_keys('rkus6987')
      print(&quot;Entering the username&quot;)
      passw = chrome.find_element_by_name(&quot;password&quot;)
      print(&quot;Fidning the password&quot;)
      passw.send_keys('ayush 1234')
      print(&quot;Entering the password&quot;)
      passw.send_keys(Keys.RETURN)
      time.sleep(5.5)
      notn = chrome.find_element_by_class_name(&quot;yWX7d&quot;)
      print(&quot;Clicking the Not Now button&quot;)
      notn.click()
      time.sleep(3)
  
  #! Opeing Post
  
  def post():
      
      pic = chrome.find_element_by_class_name(&quot;_aagw&quot;).click()
      print(&quot;Finding the First Picture&quot;)
      time.sleep(2)
  
  
  #! Screen Shot
  
  def screen_shot(path):
      print(&quot;Taking Scrrenshot&quot;)
      image = pyautogui.screenshot()
      print(&quot;Changing Extensions&quot;)
      
      image = cv2.cvtColor(np.array(image),
                           cv2.COLOR_RGB2BGR)
  
      cv2.imwrite(path , image)
      cv2.waitKey(0)
      Image = image.open(path)
      im1 = Image.crop((left, top, right, bottom))
      im1 = im1.save(path)
  
  </code></pre>
  <p>You can use <code>geeks_for_geeks</code> as the first input
  <a href="https://i.stack.imgur.com/6gNnj.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Ignore the <code>Deprecitation error for some time</code>
  The program was giving error for <code>crop</code> attribute before. I tried to first save the orginal scren shot and then do the croping procedure. The image is saved in the designeted folder but now program is not able to open the image. After some debugging I got to the point that there is no problem with the path
  Here is the geeks for geeks code : <a href="https://www.geeksforgeeks.org/download-instagram-posts-using-python-selenium-module/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/download-instagram-posts-using-python-selenium-module/</a></p>