cvhau / pinterest-client

A simple python client for Pinterest that support user interact with Pinterest such as simple browser.
35 stars 12 forks source link

TypeError when trying to login #6

Open Latand opened 6 years ago

Latand commented 6 years ago

Hey, I'm trying to login, but TypeError is raised.

TypeError: a bytes-like object is required, not 'str'

>>> logged_in = pinterest.login()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\User\Documents\GitHub\pinterest-client\pinterest\Pinterest.py", line 110, in login
    self.user = self.extract_user_data(r.content)
  File "C:\Users\User\Documents\GitHub\pinterest-client\pinterest\Pinterest.py", line 93, in extract_user_data
    s = html_page[html_page.rfind('application/json'):]
TypeError: a bytes-like object is required, not 'str'
bryanmorganoverbey commented 5 years ago

works for me...

bryanmorganoverbey commented 5 years ago

from pinterest import Pinterest pinterest = Pinterest(username_or_email='username', password='pass')

^^make sure you have these lines first

qwhex commented 5 years ago

You should run it with Python2

Latand commented 5 years ago

Too bad.