Scrapy: Define items dynamically

前端 未结 5 1376
别跟我提以往
别跟我提以往 2021-02-05 10:23

As I started to learn scrapy, i have come accross a requirement to dynamically build the Item attributes. I\'m just scraping a webpage which has a table structure and I wanted t

5条回答
  •  孤街浪徒
    2021-02-05 10:39

    In Scrapy 1.0+ the better way could be to yield Python dicts instead of Item instances if you don't have a well-defined schema. Check e.g. an example on http://scrapy.org/ front page - there is no Item defined.

提交回复
热议问题