Skip to content

Commit b6df965

Browse files
Some cleanup
1 parent d11856c commit b6df965

File tree

1 file changed

+2
-16
lines changed
  • src/board_game_scraper/spiders

1 file changed

+2
-16
lines changed

src/board_game_scraper/spiders/bgg.py

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from __future__ import annotations
22

3-
import pprint
43
import re
54
from typing import TYPE_CHECKING, Any
65

7-
from attrs import asdict
86
from scrapy.http import TextResponse
97
from scrapy.selector.unified import Selector, SelectorList
108
from scrapy.spiders import SitemapSpider
@@ -96,16 +94,7 @@ def parse( # noqa: PLR0915
9694
@url https://boardgamegeek.com/xmlapi2/thing?id=13,822,36218&type=boardgame&videos=1&stats=1&comments=1&ratingcomments=1&pagesize=100&page=1
9795
@returns items 303 303
9896
@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
10998
"""
11099

111100
assert isinstance(response, TextResponse)
@@ -242,7 +231,6 @@ def parse( # noqa: PLR0915
242231
game_item = gldr.load_item()
243232
assert isinstance(game_item, GameItem)
244233
assert isinstance(game_item.bgg_id, int)
245-
pprint.pp(asdict(game_item))
246234
yield game_item
247235

248236
for comment in game.xpath("comments/comment"):
@@ -251,6 +239,4 @@ def parse( # noqa: PLR0915
251239
cldr.add_xpath("bgg_user_name", "@username")
252240
cldr.add_xpath("bgg_user_rating", "@rating")
253241
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

Comments
 (0)