강의

멘토링

커뮤니티

Inflearn Community Q&A

romantage2438165's profile image
romantage2438165

asked

Introduction to Python for Programming and Data Science

xml 분석 중

Written on

·

168

0

ipg140107.xml 분석 과제하고 있습니다.

'상태' 정보를 추출하기 위해서는 <us-patent-application ... status ="PRODUCTION" ...>부분을 추출해야 할 것 같은데 어떻게 하면 추출할 수 있는지 궁금합니다.

 

pythonbigdata

Answer 1

0

TeamLab님의 프로필 이미지
TeamLab
Instructor

아래 코드를 참고해볼 수 있을거 같습니다.

status는 attribute라고 할 수 있는데 values["from"] 과 같이 attribute를 뽑아서 쓸 수가 있습니다.

Findall로 처음 element를 뽑고 다음으로 ["status"]를 사용해서 attribute를 뽑으면 될 거 같습니다.

https://stackoverflow.com/questions/45386116/extracting-similar-xml-attributes-with-beautifulsoup

romantage2438165's profile image
romantage2438165

asked

Ask a question