Python Forum
I wan't to Download all .zip Files From A Website (Project AI)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I wan't to Download all .zip Files From A Website (Project AI)
#4
The way to solve something like this is to get down to the basics.
Your code seems to run OK up step 30.
the URL for the first request is:
Output:
http://web.archive.org/web/20031124231537/http://www.projectai.com:80/libraries/download.php?fileid={3810}
so try that by utself with requests:
import requests

url = 'http://web.archive.org/web/20031124231537/http://www.projectai.com:80/libraries/download.php?fileid={3810}'

response = requests.get(url)
print('status code: {}'.format(response.status_code))
if response.status_code == 200:
    print('saving page')
    with open('results.html', 'wb') as fp:
        fp.write(response.content)
it returns a 404 error which is:
Quote:404 Not Found
The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.

if you try that url by itself (in browser), it brings you to a wayback machine error page:
Output:
Hrm. The Wayback Machine has not archived that URL. This page is not available on the web because page does not exist
Try it!
If you can find the actual url, then you can go from there (use dead-eye's code)
NOTE: a session is a good idea, but not strictly needed to download zip files, I do it all the time.
Reply


Messages In This Thread
RE: I wan't to Download all .zip Files From A Website (Project AI) - by Larz60+ - Aug-25-2018, 03:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Website scrapping and download santoshrane 3 4,397 Apr-14-2021, 07:22 AM
Last Post: kashcode
  Login and download an exported csv file within a ribbon/button in a website Alekhya 0 2,700 Feb-26-2021, 04:15 PM
Last Post: Alekhya
  Cant Download Images from Unsplash Website firaki12345 1 2,339 Feb-08-2021, 04:15 PM
Last Post: buran
  Download some JPG files and make it a single PDF & share it rompdeck 5 5,762 Jul-31-2020, 01:15 AM
Last Post: Larz60+
  download pdf file from website m_annur2001 1 3,043 Jun-21-2019, 05:03 AM
Last Post: j.crater
  Access my webpage and download files from Python Pedroski55 7 5,749 May-26-2019, 12:08 PM
Last Post: snippsat
  Download all secret links from a map design website fyec 0 2,882 Jul-24-2018, 09:08 PM
Last Post: fyec
  I Want To Download Many Files Of Same File Extension With Either Wget Or Python, eddywinch82 15 14,741 May-20-2018, 06:05 PM
Last Post: eddywinch82

Forum Jump:

User Panel Messages

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