Говнокод остался говнокодом
This commit is contained in:
parent
ebae53a81c
commit
617b503a3b
@ -45,10 +45,10 @@ def docs_parse():
|
||||
except Exception: pass
|
||||
try: output = one_parser(soup, output); #print(output)
|
||||
except Exception: pass
|
||||
try: output = parser_two(soup, output); print(output)
|
||||
except Exception as e: raise(e)
|
||||
try: output = parser_two(soup, output); #print(output)
|
||||
#except Exception as e: pass
|
||||
#try: output = parser3(soup, output); print(output)
|
||||
#except Exception as e: raise(e)
|
||||
except Exception as e: raise(e)
|
||||
|
||||
|
||||
with open(config.data_file, 'w') as f:
|
||||
|
@ -24,14 +24,14 @@ def table_parser(soup, output):
|
||||
def one_parser(soup, output):
|
||||
raw_data = soup.find("main").findAll("p")
|
||||
date = (
|
||||
raw_data[3].find("span", style="font-size:16px;").b.text.lower()
|
||||
raw_data[3].text.lower()
|
||||
.replace(u"\xa0", u"").replace("на", "").replace("\r", "")
|
||||
.replace("ЗАМІНИ ДО РОЗКЛАДУ".lower(), "").split("\n")
|
||||
)
|
||||
output["date"] = date[1].lstrip(" ")
|
||||
output["date"] = date[0].lstrip(" ")
|
||||
|
||||
for p in raw_data[4].find("span",style="font-size:16px;").b.text.replace(u"\xa0", u"").split("\n"):
|
||||
p = p.lstrip(" ")
|
||||
for p in raw_data[4].text.replace(u"\xa0", u"").split("\n"):
|
||||
if p == "": continue
|
||||
data_rep = (p.lstrip(" ").split(" ", 1))
|
||||
group = data_rep[0]
|
||||
text = data_rep[1].replace("\r", "").lstrip(" ")
|
||||
|
Loading…
Reference in New Issue
Block a user