Telegram Bot using Web Crawler based on Selenium Posted on 2021-08-13 In Etc. 12345678910111213141516171819202122232425262728293031323334import timefrom selenium import webdriverimport telegramdef updateStatus(): browser.find_element_by_xpath('//*[@id="paramInvcNo"]').send_keys(num) browser.find_element_by_xpath('//*[@id="btnSubmit"]').click() status = browser.find_element_by_xpath('//*[@id="statusDetail"]') return status.textoptions = webdriver.ChromeOptions()options.add_argument('headless')options.add_argument('window-size=1920x1080')options.add_argument("disable-gpu")browser = webdriver.Chrome("Location of Chrome Driver", options = options)browser.implicitly_wait(5)url = 'https://www.cjlogistics.com/ko/tool/parcel/tracking'browser.get(url)myToken = 'TelegramToken'bot = telegram.Bot(token = myToken)chat_id = ID#bot.getUpdates()[-1].message.chat.id #가장 최근에 온 메세지의 chat id를 가져옵니다num = 운송장 번호statusArr = ["", ""]i = 0while True: status = updateStatus() statusArr[i%2] = str(status) if statusArr[0] != statusArr[1]: bot.sendMessage(chat_id=chat_id, text=statusArr[i%2]) print('Different') browser.refresh() time.sleep(1) i = i+1
Numpy Posted on 2021-02-28 In 5. Machine Learning Initialize0으로 초기화init_zero.py123456789101112131415import numpy as npa = np.zeros(5)b = np.zeros((5,4))print('a = ', a)print('********************')print('b = ', b)print('********************')print('b.shape = ', b.shape)print('********************')print('b.ndim', b.ndim) #len(b.shape)print('********************')print('b.size = ', b.size) Read more »
Exporting AI Model to C++ from MATLAB Posted on 2021-02-26 In 5. Machine Learning MATLAB Coder MATLAB Coder를 통해 C 또는 C++ 코드를 생성할 수 있다. Export types 소스 코드 정적 라이브러리 동적 라이브러리 Prerequisites for Deep Learning Intel CPUs Intel Math Kernel Library for Deep Neural Networks (Intel MKL-DNN) ARM CPUs ARM Compute Library Read more »
Development of a Obstructive Sleep Apnea Diagnosis Algorithm using HRV Posted on 2021-01-14 In Etc. Source in Github HRV(Heart Rate Variability)Detecting R-R IntervalrrInterval.mat123456789function [qrspeaks, locs, y] = rrInterval(time, ecg)t = time;wt = modwt(ecg, 5);wtrec = zeros(size(wt));wtrec(4:5, :) = wt(4:5, :);y = imodwt(wtrec, 'sym4');y = abs(y).^2;[qrspeaks, locs] = findpeaks(y, t, 'MinPeakHeight', 0.1, 'MinPeakDistance', 0.450); %time과 y에 대한 그래프를 해석 후 파라미터 결정end ECG 12>> load mit200>> plot(tm, ecgsig) Read more »