Wizard Book


Programming Python, Web, Android

Python: Pinterest Image Downloader dengan pinterest-image-scrapper

Mendownload Image dari Pinterest Otomatis menggunakan Python pinterest-image-scrapper

#https://github.com/xjdeng/pinterest-image-scraper

E:\Python364>Scripts\pip.exe install selenium

#jika memakai firefox
#https://github.com/mozilla/geckodriver/releases
#download https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-win64.zip
#unzip, letakkan di satu direktori dgn script, Python\pinterest\pinterest-image-scraper-master\pinterest_scraper

#jika memakai chrome
E:\Python364>Scripts\pip.exe install chromedriver-binary

#https://sites.google.com/a/chromium.org/chromedriver/downloads
#download https://chromedriver.storage.googleapis.com/index.html?path=75.0.3770.90/
#unzip, letakkan di satu direktory dgn script, Python\pinterest\pinterest-image-scraper-master\pinterest_scraper

E:\>cd Python\pinterest\pinterest-image-scraper-master\pinterest_scraper

E:\Python\pinterest\pinterest-image-scraper-master\pinterest_scraper>E:\Python364\python.exe
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scraper as s
>>> from selenium import webdriver
>>> chrome = webdriver.Chrome()
>>> ph = s.Pinterest_Helper('username@gmail.com', 'xxxxxxpassxxx', chrome)
>>> images = ph.runme("https://id.pinterest.com/g1ebru/neymar-jr-wallpaper/")
>>> print(images)
>>> imagesurl=[]
>>> for i in range(len(images)):
...     imagesurl.append(images[i].decode('utf-8'))
...     
>>> s.download(imagesurl)

#jika tidak semua gambar didownload, misalnya hilangkan 100 terakhir
>>> del imagesurl[-100:]
>>> s.download(imagesurl)

email : contohprogram.com@gmail.com
WA : +6289671400363