Home > other >  Python is a small white
Python is a small white

Time:09-24

Python is a small white
The following code error, request bosses give directions

#! The/usr/bin/env python
# - * - coding: utf-8 - * -
The import urllib. Request
The from bs4 import BeautifulSoup
Url='https://www.globsnow.info/swe/archive_v2.0/2005/L3A_daily_SWE_HDF/'
Tr=urllib. Request. Urlopen (url). The read (). The decode (' ASCII)
Soup=BeautifulSoup (tr, '. The HTML parser)
Url_cand_html=soup. Find_all (' tr)
List_urls=url_cand_html [4]. The find (" td "). The find (' a ')
Urls=[]

# urls. Append (list_urls. Get (' href '))
Urls=urllib. Request. Get (' href ')
Print (" This is the file "+ STR () +" downloading!
")File_name="D://data//data/" + url. The split ('/') [1]
Urllib. Request. Urlretrieve (url, file_name)
  • Related