Waqas
Waqas

Reputation: 639

Scrapy + sqlalchemy + mysql error

and i am building a web crawler for personal use.

Here is the Spider file

scrapySpider

Here is the model file

model

Here is the pipe line

pipeline

My database settings are

DATABASE = {'drivername': 'mysql+mysqldb',
        'host': 'localhost',
        'port': '3306',
        'username': 'user', # fill in your username here
        'password': 'pass', # fill in your password here
        'database': 'scrapydb'}

But i am getting this error

  .............., line 19, in process_item
  vehicle = vehicles(**item)
  exceptions.TypeError: vehicles() got an unexpected keyword argument 'odometer'

I've tried many things but was unsuccessful. Please help!

Upvotes: 1

Views: 929

Answers (1)

alecxe
alecxe

Reputation: 474003

vehicles should be a class, not a function:

class vehicles(DeclarativeBase):
    ...

Upvotes: 1

Related Questions