-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update dependencies and removed mysql code
- Loading branch information
Showing
12 changed files
with
20 additions
and
730 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +0,0 @@ | ||
from bs4 import BeautifulSoup | ||
from sqlalchemy.ext.asyncio import AsyncSession | ||
|
||
from utils.db.crud.extract import extract_data_from_db | ||
|
||
|
||
def parser_coordinators(session: AsyncSession) -> dict: | ||
"""Парсер контактов координаторов из таблицы html.""" | ||
sql_request = ( | ||
"SELECT post_content FROM detfond_posts WHERE post_name IN" | ||
'("kontakty-koordinatorov")' | ||
) | ||
data = extract_data_from_db(session, sql_request) | ||
results = {"results": []} | ||
soup = BeautifulSoup(data, features="lxml") | ||
tbody_tag = soup.find("tbody") | ||
tr_tags = tbody_tag.find_all("tr") | ||
attributes_dict = [tr_tag.text for tr_tag in tr_tags[0]][1::2] | ||
for tr_tag in tr_tags[1:]: | ||
td_tags = tr_tag.find_all("td") | ||
index = 0 | ||
result = {} | ||
for td_tag in td_tags: | ||
result[attributes_dict[index]] = td_tag.text | ||
index += 1 | ||
results["results"].append(result) | ||
return results | ||
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.