fork(1) download
  1. import re
  2. html_source_det = '''
  3. <tr>
  4. <td width="35%">Demand No</td>
  5. <td width="65%"><input type="text" name="T1" size="12" onFocus="this.blur()" value="876716001"></td>
  6. </tr>'''
  7.  
  8.  
  9. match_det = re.compile(r'<td width="35.+?">(.+?)</td>').findall(html_source_det)
  10. print match_det
  11.  
  12. match_det = re.compile('<td width="35.+?">(.+?)</td>\n'
  13. '<td width="65.+?value="(.+?)"></td>').findall(html_source_det)
  14. print match_det
  15.  
Success #stdin #stdout 0.01s 7692KB
stdin
Standard input is empty
stdout
['Demand No']
[('Demand No', '876716001')]