Skip to content

Commit

Permalink
Fix failure in appearances crawler (#82)
Browse files Browse the repository at this point in the history
Fixes #81
  • Loading branch information
dcaribou authored Jan 10, 2024
1 parent 266d6f6 commit 34a2a3e
Show file tree
Hide file tree
Showing 6 changed files with 571 additions and 403 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.7
938 changes: 566 additions & 372 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python = "^3.8"
inflection = "^0.5.1"
Protego = "^0.2.1"
python-dateutil = "^2.8.2"
Scrapy = "2.7.1"
scrapy = "^2.11.0"

[tool.poetry.dev-dependencies]

Expand Down
28 changes: 0 additions & 28 deletions samples/players.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tfmkt/spiders/appearances.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def parse_stats_elem(elem):

# stats tables are 'responsive-tables' (except the first one, which is
# a summary table)

competitions = response.css(
'div.table-header > a::attr(name)'
'div.content-box-headline > a::attr(name)'
).getall()
stats_tables = response.css('div.responsive-table')[1:]
assert(len(competitions) == len(stats_tables))
Expand Down
2 changes: 1 addition & 1 deletion tfmkt/spiders/competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def parse_competitions(self, response, base):
"""Parse competitions from the country competitions page.
@url https://www.transfermarkt.co.uk/wettbewerbe/national/wettbewerbe/157
@returns items 2 2
@returns items 3 3
@cb_kwargs {"base": {"href": "some_href/3", "type": "competition", "parent": {}, "country_id": 1, "country_name": "n", "country_code": "CC"}}
@scrapes type href parent country_id country_name country_code competition_type
"""
Expand Down

0 comments on commit 34a2a3e

Please sign in to comment.