Complete the following code to extract an image โcover3.jpgโ from the URL โhttp://data.pr4e.org/cover3.jpgโ and host โdata.pr4e.orgโ. There are 5 empty spaces.
import urllib.request
fhand = urllib.request.urlopen('http://data.pr4e.org/clown.txt')
for line in fhand:
words = line.decode().strip()
print(words)
for word in words:
counts[word] = counts.get(word, 0) + 1
print(counts)
Write a program that retrives a txt file from โhttps://www.gutenberg.org/files/1342/1342-0.txtโ in several blocks of 100,000 characters, joins them and saves as โprideandprejudice.txtโ to disk and prints number of characters.
Write a program that retrives a txt file from โhttps://www.gutenberg.org/files/16/16-0.txtโ in several blocks of 100,000 characters, joins them and saves as โpeterpan.txtโ to disk and prints number of characters.
Write code that extracts data from several parts of the โaโ tag from โhttp://www.dr-chuck.com/page1.htmโ using BeautifulSoup and html.parser and print the tag, href, contents as well as all the attributes.