import requests
datalinks = requests.get('http://some website.com/list of download links/downloaded files')
After parsing URL I get groups of links:
http://somewebsite.com/index.php?id=1234&x=q&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=w&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=e&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=r&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=t&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=y&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=u&download=1&suffix=3a
http://somewebsite.com/index.php?id=1234&x=i&download=1&suffix=3a
...
Clicking each link automatically downloads a file.
What's the script to:
download the file of every link to folder (e.g. C:\Users\user\downloaded files)
download file of only one link from each group (e.g. only download link with
&x=r
in the name)
I think you somehow use the write function from request library which will download one file
datalinks = requests.get('http://some website.com/list of download links/downloaded files')
with open("C:\Users\user\downloaded files\file.filetype", 'wb') as f:
f.write(datalinks.content)
Do I loop that to write (download) multiple files to my folder?
Is it looping in Python? Do I use re.search
somehow? Is it using scrapy somehow?