Jul-12-2017, 08:21 PM
Hi,
This is a similar question to what I posted earlier, however I've made some improvements and my function is (almost) doing what I want it to do. This code below is opening the same url that contains different data every time it opens, every 3 seconds and retrieving the text from it. However, every time the URL opens I would like a separate text file for the results, right now it updates the "testing.txt" file and saves the latest result from when I close exit the function.
I'd like a separate file for each 3 second interval, but if all results are stored into one master text file that works for me as well. Any and all help is welcome, thank you!!
This is a similar question to what I posted earlier, however I've made some improvements and my function is (almost) doing what I want it to do. This code below is opening the same url that contains different data every time it opens, every 3 seconds and retrieving the text from it. However, every time the URL opens I would like a separate text file for the results, right now it updates the "testing.txt" file and saves the latest result from when I close exit the function.
I'd like a separate file for each 3 second interval, but if all results are stored into one master text file that works for me as well. Any and all help is welcome, thank you!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import webbrowser import schedule import time import urllib def job(): schedule.every( 3 ).seconds.do(job) while 1 : schedule.run_pending() time.sleep( 1 ) |