Skip to content

Commit

Permalink
fix: fixed parsing after blizzard change of main div (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeKrop authored Nov 12, 2024
1 parent 20341ed commit 9baecbe
Show file tree
Hide file tree
Showing 52 changed files with 822 additions and 771 deletions.
4 changes: 3 additions & 1 deletion app/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def store_response_data(self, response: httpx.Response) -> None:
self.create_parser_tag(response.text)

def create_parser_tag(self, html_content: str) -> None:
self.root_tag = LexborHTMLParser(html_content).css_first("main")
self.root_tag = LexborHTMLParser(html_content).css_first(
"div.main-content,main"
)


class JSONParser(APIParser):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "overfast-api"
version = "3.5.0"
version = "3.5.1"
description = "Overwatch API giving data about heroes, maps, and players statistics."
license = {file = "LICENSE"}
authors = [
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def _patch_before_every_test(redis_server: fakeredis.FakeStrictRedis):

with (
patch("app.helpers.settings.discord_webhook_enabled", False),
patch("app.helpers.settings.profiler", None),
patch(
"app.cache_manager.CacheManager.redis_server",
redis_server,
Expand Down
33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/ana.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/ashe.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/baptiste.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/bastion.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/brigitte.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/cassidy.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/doomfist.html

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions tests/fixtures/html/heroes/dva.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/echo.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/genji.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/hanzo.html

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions tests/fixtures/html/heroes/illari.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/junker-queen.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/junkrat.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/juno.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/kiriko.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/lifeweaver.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/lucio.html

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions tests/fixtures/html/heroes/mauga.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/mei.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/mercy.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/moira.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/orisa.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/pharah.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/ramattra.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/reaper.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/reinhardt.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/roadhog.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/sigma.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/sojourn.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/soldier-76.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/sombra.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/symmetra.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/torbjorn.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/tracer.html

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions tests/fixtures/html/heroes/venture.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/widowmaker.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/winston.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/wrecking-ball.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/zarya.html

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions tests/fixtures/html/heroes/zenyatta.html

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions tests/fixtures/html/home.html

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions tests/fixtures/html/players/JohnV1-1190.html

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions tests/fixtures/html/players/KIRIKO-21253.html

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions tests/fixtures/html/players/TeKrop-2217.html

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions tests/fixtures/html/players/Unknown-1234.html

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions tests/fixtures/html/search.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9baecbe

Please sign in to comment.