Using Selenium read MEATR ,SPECI and TAF from NSWEB. Update:
- Memory consuming was solved by using web-function embeded
- Only one class for reading METAR/SPECI and TAF
- Total time per loop is 1 minute
Use the package manager pip to install nsbot.
pip install nsbot
or
pip install nsbot==0.0.3
from nsbot import MetarSpeciTaf
chrome_driver=".exe" #location of [chrome_driver.exe]
line_token=""
time_stop="04" #UTC time
obj = MetarSpeciTaf(chrome_driver,line_token, time_stop)
obj.setupDriver()
obj.run_bot()
To hide chromeDriver console in python
Step1: Find service.py in your selenium directory
Step2: Edit the Start() function by adding the creation flags (creationflags=CREATE_NO_WINDOW)
def start(self):
"""
Starts the Service.
:Exceptions:
- WebDriverException : Raised either when it can't start the service
or when it can't connect to the service
"""
try:
cmd = [self.path]
cmd.extend(self.command_line_args())
self.process = subprocess.Popen(cmd, env=self.env,
close_fds=platform.system() != 'Windows',
stdout=self.log_file,
stderr=self.log_file,
creationflags=CREATE_NO_WINDOW)
except TypeError:
Step3: Add the relevant imports to service.py
from win32process import CREATE_NO_WINDOW
!!! You need to download chromDriver which is suitable with your systems.
...... | ...... |
---|---|
kanutsanun.b@gmail.com | |
Build README | https://dillinger.io/ |