trade dextools devika prompts

This commit is contained in:
Dobromir Popov 2024-05-18 01:14:47 +03:00
parent d225843ad9
commit 62d16a8d50
5 changed files with 51 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
create a python app that will watch for new pairs on https://www.dextools.io/app/en/pairs (we need to crawl that with JS enabled to pull the actual content) and provide option to execute a HTTP request to an API to inform about the new pair

View File

@ -4,6 +4,12 @@ conda activate devika
which python
/config/miniconda3/envs/devika/bin/python -m pip install -r requirements.txt
fix browser issue
#apt --fix-broken install
#sudo apt-get update
#sudo apt-get install libnss3
/ui#>?
playwright install --with-deps
npm install

View File

@ -1,14 +1,22 @@
import requests
from bs4 import BeautifulSoup
import schedule
# import schedule
import time
# pip install requests beautifulsoup4 schedule
def check_new_pairs():
# log the running time
print("Checking for new pairs...")
url = "https://www.dextools.io/"
url = "https://www.dextools.io/app/en/bnb/pool-explorer"
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
# make html dump to ./dextools-last.html
with open('dextools-last.html', 'w') as f:
f.write(soup.prettify())
# Assuming the pairs are listed in <div> tags with a class that includes the word 'pair'
pairs = soup.find_all('div', class_=lambda x: x and 'pair' in x)
@ -26,11 +34,12 @@ def check_new_pairs():
check_new_pairs.last_pairs = current_pairs
def main():
schedule.every(10).seconds.do(check_new_pairs)
#schedule.every(10).seconds.do(check_new_pairs)
while True:
schedule.run_pending()
time.sleep(1)
# schedule.run_pending()
check_new_pairs()
time.sleep(10000)
if __name__ == "__main__":
main()

View File

@ -1 +1,12 @@
https://github.com/ccxt/ccxt/tree/master/examples/py/
https://github.com/ccxt/ccxt/tree/master/examples/py/
playwright._impl._errors.TargetClosedError: Target page, context or browser has been closed
Browser logs:
<launching> /config/.cache/ms-playwright/chromium-1105/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-kMyQDr --remote-debugging-pipe --no-startup-window
<launched> pid=1019347
[pid=1019347][err] /config/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
[pid=1019347] <process did exit: exitCode=127, signal=null>
[pid=1019347] starting temporary directories cleanup