- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
response = conn.getresponse()
data = response.read()
s_list = list(data)
i, j = 0, 0
while i < len(s_list):
if s_list[i] == '<':
while s_list[i] != '>':
s_list.pop(i)
s_list.pop(i)
elif s_list[i] == '\n':
s_list.pop(i)
elif s_list[i] == '\t':
s_list.pop(i)
else:
i = i+1
data = str(s_list).replace('\'','').replace(' ','').replace(',','').\
replace(' ','').replace('SERegistru','').replace('[','').\
replace(']','').replace(':','').replace(';','').\
replace('IDNP','').replace('LastName',' ').\
replace('FirstName',' ').replace('SecondName',' ').replace('Alive',' ')
Простой парсер HTML странички.. ^_^