1
1
from __future__ import annotations
2
2
3
- import pprint
4
3
import re
5
4
from typing import TYPE_CHECKING , Any
6
5
7
- from attrs import asdict
8
6
from scrapy .http import TextResponse
9
7
from scrapy .selector .unified import Selector , SelectorList
10
8
from scrapy .spiders import SitemapSpider
@@ -96,16 +94,7 @@ def parse( # noqa: PLR0915
96
94
@url https://boardgamegeek.com/xmlapi2/thing?id=13,822,36218&type=boardgame&videos=1&stats=1&comments=1&ratingcomments=1&pagesize=100&page=1
97
95
@returns items 303 303
98
96
@returns requests 0 0
99
- @scrapes name alt_name year description \
100
- designer artist publisher \
101
- url image_url video_url \
102
- min_players max_players min_players_rec max_players_rec \
103
- min_players_best max_players_best \
104
- min_age min_age_rec min_time max_time \
105
- game_type category mechanic cooperative compilation family expansion \
106
- rank add_rank num_votes avg_rating stddev_rating \
107
- bayes_rating complexity language_dependency \
108
- bgg_id scraped_at
97
+ @scrapes bgg_id scraped_at
109
98
"""
110
99
111
100
assert isinstance (response , TextResponse )
@@ -242,7 +231,6 @@ def parse( # noqa: PLR0915
242
231
game_item = gldr .load_item ()
243
232
assert isinstance (game_item , GameItem )
244
233
assert isinstance (game_item .bgg_id , int )
245
- pprint .pp (asdict (game_item ))
246
234
yield game_item
247
235
248
236
for comment in game .xpath ("comments/comment" ):
@@ -251,6 +239,4 @@ def parse( # noqa: PLR0915
251
239
cldr .add_xpath ("bgg_user_name" , "@username" )
252
240
cldr .add_xpath ("bgg_user_rating" , "@rating" )
253
241
cldr .add_xpath ("comment" , "@value" )
254
- collection_item = cldr .load_item ()
255
- pprint .pp (asdict (collection_item ))
256
- yield collection_item
242
+ yield cldr .load_item ()
0 commit comments