Expand|Select|Wrap|Line Numbers
- import urllib2
- request = urllib2.urlopen('http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=2000')
- source= request.read()
- import re
- name = re.compile(r'size=\"\+1\"\>\<b\>(\d+) (\w+)')
- thename = name.search(source)
Expand|Select|Wrap|Line Numbers
- thename.group(1)
----
Another thing I don't get how to implement in regex, is how to match ranges such as 2001-3000. I tried using the following, which apparently did not work:
Expand|Select|Wrap|Line Numbers
- list = re.compile(r'size=\"\+1\"\>\<b\>[2001-3000] \w+')