Skip to content

의안의 부가정보 수집하기 #39

@e9t

Description

@e9t

screen shot 2015-12-03 at 7 31 30 pm

[image source]

지금은 의안 크롤러가 의안의 "부가정보"를 수집하지 않고 있는데, 대안 의안들의 경우 이 영역에 관련 의안이 표기되어 있기 때문에 무척 중요한 정보를 놓치고 있는 꼴입니다. 이 데이터를 추가적으로 수집하기 위해서는 html을 json으로 파싱하는 파일을 수정하면 됩니다.

  • 현재

    for i, r in enumerate(elem_row_contents):
        if row_titles[i]!='부가정보':  # "부가정보" 외의 다른 영역(행)들 처리
            status_dict[row_titles[i]] = extract_row_contents(r)
        else:  # "부가정보" 영역 처리
            t = r.xpath('span[@class="text8"]/text()')
            c = filter(None, (t.strip() for t in r.xpath('text()')))
            status_dict[row_titles[i]] = dict(zip(t, c))
  • 개선: 아마 위의 코드 snippet에서 "부가정보" 영역을 처리하는 곳에서 xpath가 정상적으로 작동하지 않는 것 같습니다. 디버깅하는 것이 아마 크게 어려운 일은 아닐 것 같은데, html 파일을 다시 찬찬히 뜯어보는 노력이 필요합니다.

혹시 xpath의 사용법에 익숙하지 않으신 분들이 있다면 다음 링크를 확인해주시기 바랍니다: http://www.slideshare.net/lucypark/the-beginners-guide-to-54279917/49

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28812970-?utm_campaign=plugin&utm_content=tracker%2F248104&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F248104&utm_medium=issues&utm_source=github).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions