Skip to content

Commit

Permalink
:fix: Forex provider parser
Browse files Browse the repository at this point in the history
  • Loading branch information
esemi committed Apr 10, 2024
1 parent ef572c8 commit c119566
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
./pyproject.toml => $TARGET_DIR
last_ssh: |-
$VENV_BIN/pip install --no-cache-dir poetry pip setuptools --upgrade
$VENV_BIN/pip install --no-cache-dir poetry pip setuptools
$VENV_BIN/poetry config virtualenvs.create false --local
$VENV_BIN/poetry install --no-dev
$VENV_BIN/poetry install --only main
$VENV_BIN/pip cache purge
echo 'telegram_token=${{ secrets.TELEGRAM_PROD_TOKEN }}' > .env
supervisorctl restart stonks:*
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion app/rate_providers/forex.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _parse_xe_rate(html_source: str) -> Decimal:
stringify = etree.XPath('string()')
try:
html_rate = stringify(
etree.HTML(html_source).xpath('//main//p[contains(@class, "result__BigRate")]')[0],
etree.HTML(html_source).xpath('//main//div/p/span[contains(@class, "faded-digits")]/parent::p')[0],
)

except (AttributeError, IndexError):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "stonks"
version = "0.1.0"
description = ""
authors = ["Simon <[email protected]>"]
package-mode = false

[tool.poetry.dependencies]
python = "^3.9"
Expand Down

0 comments on commit c119566

Please sign in to comment.