Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import urllib
  2. import re
  3. htmlfile=urllib.urlopen("http://forecast.weather.gov/product.php?site=NWS&issuedby=FWD&product=RR5&format=CI&version=1&glossary=0")
  4. htmltext=htmlfile.read()
  5. regex='<pre class="glossaryProduct">(.+?)</pre>'
  6. pattern=re.compile(regex)
  7. out=re.findall(pattern, htmltext)
  8. print (out)
  9.  
  10. import urllib
  11. file1 = urllib.urlopen('http://forecast.weather.gov/product.php?site=NWS&issuedby=FWD&product=RR5&format=txt&version=1&glossary=0')
  12. s1 = file1.read()
  13. print(s1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement