Python Forum
Creating multiple text fies from new url retrieve results
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating multiple text fies from new url retrieve results
#1
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!!

import webbrowser
import schedule
import time
import urllib


def job():
    webbrowser.open('http://127.0.0.1:56781/mavlink/')

    urllib.urlretrieve('http://127.0.0.1:56781/mavlink/', "testing.txt")
    

schedule.every(3).seconds.do(job)

while 1:
    schedule.run_pending()
    time.sleep(1)
Reply


Messages In This Thread
Creating multiple text fies from new url retrieve results - by wmc326 - Jul-12-2017, 08:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo put a green boarder and text around multiple pictures jackosullivan 5 1,595 Jul-05-2022, 10:39 AM
Last Post: snippsat
Question Pandas : How to create an algorithm that helps me improve results and creating new co Smordy 8 2,408 Apr-10-2022, 10:28 PM
Last Post: Larz60+
  [Answered] Retrieve a set of rows from text file knob 4 1,906 Dec-22-2021, 07:45 PM
Last Post: knob
  Replace String in multiple text-files [SOLVED] AlphaInc 5 8,393 Aug-08-2021, 04:59 PM
Last Post: Axel_Erfurt
  Open and read multiple text files and match words kozaizsvemira 3 6,877 Jul-07-2021, 11:27 AM
Last Post: Larz60+
  Reading Multiple text Files in pyhton Fatim 1 1,995 Jun-25-2021, 01:37 PM
Last Post: deanhystad
Question How to extract multiple text from a string? chatguy 2 2,479 Feb-28-2021, 07:39 AM
Last Post: bowlofred
  Writing unit test results into a text file ateestructural 3 4,925 Nov-15-2020, 05:41 PM
Last Post: ateestructural
  cx_Oracle.DatabaseError: Error while trying to retrieve text from error ORA-01804 rajeshparadker 0 8,707 Nov-12-2020, 07:34 PM
Last Post: rajeshparadker
  Search Results Web results Printing the number of days in a given month and year afefDXCTN 1 2,315 Aug-21-2020, 12:20 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020