Skip to content

ankandrew/ig-image-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram Image Scraper

Scrap instagram images given a hashtag

Usage

from ihs import Scraper, Downloader

if __name__ == "__main__":
    credentials = {
        'username': 'your_username',
        'password': 'your_password'
    }
    
    urls_path = 'scraped/urls.txt'
    
    Scraper(login=credentials,
            max_samples=10,
            url_save_path=urls_path,
            driver_path='driver/chromedriver.exe').scan(tag='happy')
    
    Downloader(url_file=urls_path,
               img_folder='img/').start(wait_time=1.0)

Installation

Run:

pip install -r requirements.txt

Then download the chrome driver from here according to your Chrome version. When creating Scraper object make sure to pass the correct path to the driver.

Disclaimer

This tool is for educational purposes only.