On 6 Mar 2006 10:08:44 -0800, "Pitmairen" <>
declaimed the following in comp.lang.python:
> 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?
>
Well, how would you do it by hand? Write down the steps you go
through to extract that information from your HTML file by hand... Clean
that up into a generalized algorithm... Write code the performs that
algorithm...
IOW: You'll going to have write code to parse the HTML (there may be
libraries available to help, but you still need to do the recognizer for
the parts you want).
>
> 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?
>
{I'm making enemies today}
Same answer... How would you do this by hand? Translate that
procedure to code.
Though I suspect, in this case, "by hand" would be to open the
entire file into memory (using notepad or some editor). Open the other
text into another memory-based editor. Select, copy, paste... But that
puts all the work of the insertion on the editor program (IE, someone
else had to code the same thing you are asking to make the editor work).
Question: how do you identify /where/ to do the insert... By number
of lines, by some keyword, etc.?
http://cis.stvincent.edu/swd/extsort/extsort.html
Modify as needed (it assumes each "line" is a record to be
sorted/merged, while you want to merge on some arbitrary boundary)
--
> ================================================== ============ <
> | Wulfraed Dennis Lee Bieber KD6MOG <
> | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <