xjdeng / pinterest-image-scraper Goto Github PK
View Code? Open in Web Editor NEWTakes the URL to a Pinterest board and returns a List of all of the image URLs on that board.
Takes the URL to a Pinterest board and returns a List of all of the image URLs on that board.
`from pinterest_scraper import scraper as s
from selenium import webdriver
chromedriverPath = '/home/shubhamturai/anaconda3/envs/pinterestScraper/lib/python3.8/site-packages/chromedriver_binary/chromedriver'
import os
os.chmod(chromedriverPath, 755)
chrome = webdriver.Chrome(chromedriverPath)
#chrome = webdriver.Chrome()
ph = s.Pinterest_Helper("[email protected]" , "xxxxxxxxxxx", chrome)
images = ph.runme("https://www.pinterest.at/search/pins/?q=rug&rs=typed&term_meta[]=rug%7Ctyped")
s.download(images, "pinterest_dataset/rug")`
The error is :
Traceback (most recent call last):
File "main.py", line 8, in
ph = s.Pinterest_Helper("[email protected]" , "xxxxxxxx", chrome)
File "/home/shubhamturai/AI/KfV/pinterest-image-scraper/pinterest_scraper/scraper.py", line 58, in init
emailElem = self.browser.find_element_by_name('id')
File "/home/shubhamturai/anaconda3/envs/pinterestScraper/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 496, in find_element_by_name
return self.find_element(by=By.NAME, value=name)
File "/home/shubhamturai/anaconda3/envs/pinterestScraper/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/home/shubhamturai/anaconda3/envs/pinterestScraper/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/shubhamturai/anaconda3/envs/pinterestScraper/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="id"]"}
(Session info: chrome=85.0.4183.121)
This is my code but I am not able to get through this email and password stuff. Please help!
All pre-build build successfully
MacOS
python 2.7
It errors on this line after running s.download(images)
outfile = mydir + "/" + os.path.basename(urlparse(myinput).path)
It may be related to the other Issue of infinite scroll since I stopped it with KeyboardInterrupt.
ph = s.Pinterest_Helper( , )
can you please provide some example
File "", line 1, in
File "/home/frostman/work_stuff/Scraped Images/pinterest-image-scraper/pinterest_scraper/scraper.py", line 58, in init
emailElem = self.browser.find_element_by_name('id')
File "/home/frostman/venvs/scrp/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 487, in find_element_by_name
return self.find_element(by=By.NAME, value=name)
File "/home/frostman/venvs/scrp/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 955, in find_element
'value': value})['value']
File "/home/frostman/venvs/scrp/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/home/frostman/venvs/scrp/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [name="id"]
This is what I get
ph = s.Pinterest_Helper( , )
File "", line 1
ph = s.Pinterest_Helper( , )
^
SintaxError: Invalid Syntax
Is there something I'm doing wrong
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [name="id"]
that's the error I've while running this line
ph = s.Pinterest_Helper('myusername' , 'mypassword')
thanks
When running command:
images =ph.runme("https://www.pinterest.co.uk/artistdrummer40/arnold-bodybuilding")
get the following error output:
>>> images =ph.runme("https://www.pinterest.co.uk/artistdrummer40/arnold-bodybuilding") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Nonwork\Downloads\pinterest-image-scraper-master\pinterest-image-scraper-master\pinterest_scraper\scraper.py", line 113, in runme dummy.send_keys(Keys.PAGE_DOWN) File "C:\Users\Nonwork\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 477, in send_keys self._execute(Command.SEND_KEYS_TO_ELEMENT, File "C:\Users\Nonwork\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute return self._parent.execute(command, params) File "C:\Users\Nonwork\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Nonwork\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotInteractableException: Message: Element <a class="dangerouslyDisableFocusStyle"> is not reachable by keyboard
Firefox however, does browse to the correct imageboard but that's as far as it goes.
How to make the scrolling stop once we have reached the end of the page ?
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/aleksandar/pinterest-image-scraper/pinterest_scraper/scraper.py", line 53, in __init__ self.browser = webdriver.Firefox(firefox_profile=profile) File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__ self.binary, timeout) File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__ self.binary.launch_browser(self.profile, timeout=timeout) File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser self._wait_until_connectable(timeout=timeout) File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 99, in _wait_until_connectable "The browser appears to have exited " selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
s.download(images, "/home/user/Documents/pinterestdir")
If the code is run from "Documents", the images will save to "Documents", whether or not a different save directory (e.g. pinterestdir) is specified.
images = ph.runme("https://www.pinterest.com.au/natalie_jane7/outdoor-portrait-photography/")
Traceback (most recent call last):
File "", line 1, in
NameError: name 'ph' is not defined
s.download(images)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'images' is not defined
images = ph.runme("https://www.pinterest.com.au/natalie_jane7/outdoor-portrait-photography/")
Traceback (most recent call last):
File "", line 1, in
NameError: name 'ph' is not defined
ph = s.Pinterest_Helper("[email protected]" , "my_password_here")
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pinterest_scraper/scraper.py", line 58, in init
emailElem = self.browser.find_element_by_name('id')
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 496, in find_element_by_name
return self.find_element(by=By.NAME, value=name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [name="id"]
From my IDE's point of view, last line of your how-tos should be
images = ph.runme()
instead of
images = s.runme()
I'm getting this error
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [name="id"]
How to fix it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.