So I have the following script which I am using to grab data from the net and save it as an html file in a folder on my pc (same pc) each time I run the script. I'm now trying to automate the process.
import pandas as pd
import datetime as dt
today_date = dt.date.today().isoformat()
df = pd.read_html('http://www.livevol.com/largest-option-trades-on-the-day', header=1)[0].set_index('Time')
html_name = 'option data/{}.html'.format(today_date)
df.to_html(html_name)
Ordinarily, when I click on the .py, I get a the black screen (command prompt) which lasts for a few seconds and then If I go to a certain folder, I see that a new html has been created.
However, when I use Windows scheduler, the script seems to run but an html file is not being created.
The script seems to be running because the command prompt black screen pops up and stays there for a few seconds (rather than just flashing), just like it did when I manually clicked on the .py file.
I've played around with the different parameters of the "actions" field of Windows Scheduler.
Program/script: C:\Python27\python.exe Add arguments: C:\Python27\Option.py
"Run when user is logged on" and "highest privileges" are check-marked.
Not sure what I'm doing wrong. Thanks.
I got it working by filling in the "Start in(optional)" parameter under the Actions tab, with the first part of the path to the Python exe.
"C:\Python27"