Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="id"]"} #17

Open
ghost opened this issue Oct 6, 2020 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 6, 2020

`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("shubhamt.ece11@vjit.ac.in" , "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("shubhamt.ece11@vjit.ac.in" , "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!

@Aquahugs
Copy link

Aquahugs commented Nov 8, 2020

I am also having this error

@rickkk856
Copy link

Same problem here... I'm not sure but it seems its not working because the chromedriver cant log in pinterest account... maybe something has changed.

---> 16 ph = s.Pinterest_Helper("Email_here" , "Password_here", chrome)
---> 58 emailElem = self.browser.find_element_by_name('id')
--> 496 return self.find_element(by=By.NAME, value=name)
--> 976 return self.execute(Command.FIND_ELEMENT, {
--> 242 raise exception_class(message, screen, stacktrace)

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="id"]"}
(Session info: chrome=86.0.4240.198)

@rickkk856
Copy link

FIXED PROBLEM --

Open Scraper.py and change in line 57

    self.browser.get("https://www.pinterest.com")

for
self.browser.get("https://br.pinterest.com/login/")

@aksthelion
Copy link

FIXED PROBLEM --

Open Scraper.py and change in line 57

    self.browser.get("https://www.pinterest.com")

for self.browser.get("https://br.pinterest.com/login/")

Sorry doesn't work for me.

@rickkk856
Copy link

@aksthelion since i'm loggin from brazil, maybe you could try only self.browser.get("https://pinterest.com/login/") instead of using the br prefix. But i'm not sure if it will still work out.... used it a long time ago, maybe they can have updated it.

@aksthelion
Copy link

Changing url doesn't have much effect, it may be some other major error. I doubt if this script still works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants