Instead of creating a batch task, I used python to create a text file. Each line had a link to be downloaded. Then I opened thunder and copied the content of the text file. Thunder monitored the clipboard changes, the pop-up dialog box for downloading all links does not actually create a batch task, but uses python to create a text file, each line has a link to download, and then starts thunder and copies the content of the text file, when thunder detects the clipboard changes, a dialog box for downloading all links is displayed ~~
This is the actual situation, because it is very difficult to analyze webpages using python, such as downloading all pdf links on a page.
from __future__ import unicode_literalsfrom bs import BeautifulSoupimport requestsimport codecsr = requests.get('you url')s = BeautifulSoup(r.text)links = s.findall('a')pdfs = []for link in links:href = link.get('href')if href.endswith('.pdf'):pdfs.append(href)with open('you file', 'w', 'gb') as f:for pdf in pdfs:f.write(pdf + '\r\n')
Create multiple files using python
# Coding = UTF-8 ''' Created on 2012-5-29 @ author: xiaochou ''' import osimport timedef nsfile (s ): '''the number of new expected events ''' # checks whether a folder exists. If not, create B = OS. path. exists ("E :\\ testFile \") if B: print "File Exist! "Else: OS. mkdir ("E :\\ testFile \") # generate the file for I in range (1, s + 1): localTime = time. strftime ("% Y % m % d % H % M % S", time. localtime () # print localtimefilename = "E: \ testFile \" + localTime + ". txt "# a: open in append mode (can be created if necessary) append; B: indicates that the binary f = open (filename, 'AB') testnote = 'test file' f. write (testnote) f. close () # output the number of files and the corresponding file name print "file" + "+ str (I) +": "+ str (localTime) + ". txt "time. sleep (1) print "ALL Down" time. sleep (1) if _ name _ = '_ main _': s = input ("Enter the number of files to be generated:") nsfile (s)
The above content is the Python batch creation of thunder tasks and the instance code for creating multiple files. I hope it will help you.