Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/xpath player transfers youth clubs #78

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/utils/xpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class MarketValue:
RANKINGS_POSITIONS = "//span[contains(@class, 'quick-fact__content--large')]//text()"

class Transfers:
YOUTH_CLUBS = "//div[@data-viewport='Jugendvereine']//div//text()"
YOUTH_CLUBS = "//div[@class='box tm-player-additional-data'][descendant::*[contains(text(), 'Youth')]]//div[@class='content']//text()"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix line length to comply with PEP 8.

The line exceeds the maximum length of 120 characters.

Split the XPath expression across multiple lines:

-        YOUTH_CLUBS = "//div[@class='box tm-player-additional-data'][descendant::*[contains(text(), 'Youth')]]//div[@class='content']//text()"
+        YOUTH_CLUBS = (
+            "//div[@class='box tm-player-additional-data']"
+            "[descendant::*[contains(text(), 'Youth')]]"
+            "//div[@class='content']//text()"
+        )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
YOUTH_CLUBS = "//div[@class='box tm-player-additional-data'][descendant::*[contains(text(), 'Youth')]]//div[@class='content']//text()"
YOUTH_CLUBS = (
"//div[@class='box tm-player-additional-data']"
"[descendant::*[contains(text(), 'Youth')]]"
"//div[@class='content']//text()"
)
🧰 Tools
🪛 Ruff

74-74: Line too long (142 > 120)

(E501)


class Stats:
ROWS = "//table[@class='items']//tbody//tr"
Expand Down
2 changes: 1 addition & 1 deletion tests/players/test_players_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_get_player_profile_8198(len_greater_than_0):
"url": And(str, len_greater_than_0),
"name": And(str, len_greater_than_0),
"description": And(str, len_greater_than_0),
"nameInHomeCountry": And(str, len_greater_than_0),
"fullName": And(str, len_greater_than_0),
"imageURL": And(str, len_greater_than_0),
"dateOfBirth": And(str, len_greater_than_0),
"placeOfBirth": {
Expand Down
Loading