Skip to content

Commit

Permalink
[scrap] 205
Browse files Browse the repository at this point in the history
  • Loading branch information
Re-st committed Nov 30, 2023
1 parent ee928ea commit fc77180
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
19 changes: 19 additions & 0 deletions scrap/local_councils/gyeongsang.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,25 @@ 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,
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
8 changes: 3 additions & 5 deletions scrap/utils/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ def scrap_all_local_councils() -> None:
197,
198,
199,
201,
202,
203,
204,
201,202,
203,204,205,
206,
208,
209,
Expand All @@ -189,7 +187,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 fc77180

Please sign in to comment.