Fetch info from website and write to txt file.
pitmairen at gmail.com
Mon Mar 6 19:08:44 CET 2006
I want to make a program that get info from a website and prints it out
in a txt file.
I made this:
f = urllib.urlopen("http://www.imdb.com/title/tt0407304/")
s = f.read()
k = open("test.txt","w")
That saves all the html code into the test.txt file. But if i for
example only want the genre, plot outline and Cast overview to be
written to the txt file. How can i do that?
And another problem i have:
If the txt file i want the information to be saved in already have some
text saved in it. How can i save the info from the website between the
text that was there before?
(inset info from website here)
More information about the Python-list