Python Forum
Python script batch download and batch rename
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python script batch download and batch rename
#4
(Oct-11-2018, 10:26 AM)jkhaksaar Wrote: Thanks, can you send me a simple because I am very new with Python,
You have to show some effort,we do not write finish solution,but try to help along the way.
Can give you some hint to get started.
Read url from a text file:
import requests

with open('url.txt') as f:
    for url_adress in f:
        print(url_adress.strip())
Output:
http://www.example.com/ http://www.example.com/some-URL/
Download example:
import requests

link = 'some url adress'
file_name = 'a_url.pdf'
with open(file_name, 'wb')as f_out:
    f_out.write(requests.get(link).content)
Rename example in this post
Reply


Messages In This Thread
RE: Python script batch download and batch rename - by snippsat - Oct-11-2018, 03:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,501 Jun-29-2023, 11:57 AM
Last Post: gologica
  python multiprocessing to download sql table mg24 5 1,568 Oct-31-2022, 03:53 PM
Last Post: Larz60+
  batch file for running python scipt in Windows shell MaartenRo 2 1,992 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  download with internet download manager coral_raha 0 3,036 Jul-18-2021, 03:11 PM
Last Post: coral_raha
  download pubmed PDFs using pubmed2pdf in python Wooki 8 5,667 Oct-19-2020, 03:06 PM
Last Post: jefsummers
  How to run script from batch file? jmair 1 4,370 Oct-12-2020, 04:29 PM
Last Post: jmair
  python script to Batch File biprabu 1 2,102 Sep-09-2020, 01:49 PM
Last Post: jefsummers
  How can I download Python files from GitHub? bitcoin10mil 2 2,887 Aug-26-2020, 09:03 PM
Last Post: Axel_Erfurt
  How to kill a bash script running as root from a python script? jc_lafleur 4 6,045 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,371 May-28-2020, 05:27 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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