Fetching the result

Sep 26, 2006
Reaction score
I have these codes for making a search on the site and getting the result.
But i need to add some specifications to this
1-getting the words from a text file or from a database (already made)
2-After getting result fetching a part of the result page.
3-Writing to an xml file or txt or html file what ever even into data base.

. But first how we can write the result as a separate txt or html file?

# #!/usr/bin/python
# # -*- coding: windows-1254; -*-
# import urllib
# dictionary = {}    # wow, it's actually a dictionary
# words = ['apple', 'banana', 'cheese']
# for word in words:
#     dictionary[word] = urllib.urlopen("http://www.example.com/look.php?w=" + word).read()
# print dictionary


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question