Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
happycastle114 committed Nov 30, 2023
2 parents c3f9c9e + b5dd469 commit 2849556
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
21 changes: 21 additions & 0 deletions scrap/local_councils/gyeongsang.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,27 @@ def scrap_204(
return ret_local_councilors(cid, councilors)


def scrap_205(
url,
cid,
args: ArgsType = None,
) -> ScrapResult:
"""경상북도 영양군"""
# TODO : gzip 문제 생기니, selenium으로 대체
print(url)
soup = get_soup(url, verify=False)
councilors: List[Councilor] = []
profile_list = soup.find("div", id="content_box")
for name_tag in profile_list.find_all("h3"):
name = name_tag.get_text(strip=True).split("(")[0] if name_tag else "이름 정보 없음"
ul = name_tag.find_next("ul")
li_party = ul.find("li", string="소속정당")
party = li_party.text.split(" : ")[-1].strip()
councilors.append(Councilor(name=name, jdName=party))

return ret_local_councilors(cid, councilors)


def scrap_206(
url,
cid,
Expand Down
2 changes: 1 addition & 1 deletion scrap/utils/runner_args.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
88, 97, 103, 107, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
124, 125, 126, 132, 134, 140, 142, 154, 155, 156, 157, 160, 161, 162, 163,
164, 165, 167, 175, 177, 178, 179, 182, 183, 184, 186, 188, 189, 190, 191, 192, 194,
195, 196, 197, 198, 199, 201, 202, 203, 204, 206, 208, 209, 210, 212, 213, 214, 215, 216,
195, 196, 197, 198, 199, 201, 202, 203, 204, 205, 206, 208, 209, 210, 212, 213, 214, 215, 216,
217, 218, 219, 220, 222, 223, 224, 226
],
"selenium_basic": [76, 78, 101, 169, 173],
Expand Down
3 changes: 2 additions & 1 deletion scrap/utils/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def scrap_all_local_councils() -> None:
202,
203,
204,
205,
206,
208,
209,
Expand All @@ -189,7 +190,7 @@ def scrap_all_local_councils() -> None:
parse_error_times = 0
timeouts = 0
N = 226
for n in [204]:
for n in [205]:
if n in no_information + error_unsolved:
emsg: str = (
(
Expand Down

0 comments on commit 2849556

Please sign in to comment.