ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/URL_Grab.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 653 byte(s)
Log Message:
Initial Import

File Contents

# Content
1 ## URL_Grab.py
2 ## This is a program that I'm creating for Zope that will grab and return parts of websites.
3 ## It will take 3 arguments ( siteUrl, startTag, endTag) and return HTML.
4 ## EBorges
5 ## 06.28.03
6
7 from urllib import urlopen
8
9 def GrabUrl(siteUrl, startTag, endTag):
10 doc = urlopen(siteUrl).read()
11 doc = doc.split(startTag)
12 doc = doc[1].split(endTag)
13 return doc[0]
14
15 if __name__ == '__main__':
16 #chop = GrabUrl('http://dictionary.reference.com/wordoftheday/', '<!-- content -->', '<!-- End content -->')
17 chop = GrabUrl('http://dictionary.reference.com/wordoftheday/', 'content', 'End content')
18 print chop