Python bs4.element.Tag.get()

사용 버전 : Python 3.6.8
사용 프로그램 : Atom 1.35.1 x64


파이썬 bs4.element.Tag.get()에 대해서 알아보겠습니다.

괄호 안에는 '태그 안의 kwargs'가 들어갑니다.

bs4.element.Tag.get()은 kwargs의 값이 추출됩니다.








제일 처음의 href="#news_cast"에서 결과물은 #news_cast만 나옵니다.


​이번엔, class로 해보겠습니다.









kwargs가 없는 부분은 None이 출력됩니다.

None의 부분을 사용자 지정 문자로 변경할 수 있습니다.








None 부분이 없음으로 표기되었습니다.

끝.



카테고리: Python, bs4

댓글

이 블로그의 인기 게시물

Python urllib.parse.quote()

KiCad 시작하기 4 (기존 회로도 수정 및 추가)

Android Compose Coil library

KiCad 시작하기 1 (회로도 만들기)

Forensics .pyc 파일 .py로 복구하기

Android Notification with Full Screen

iOS Swift callAsFunction

iOS Error Undefined symbol Testing.Trait

황전 휴게소(순천 방향) 추천 메뉴

Android Compose automation for getting localized images to use on Play Store app image