범죄 5
folium.clickForMarker( )
(1) 지도 위에 마우스를 클릭했을 때 마커를 생성
folium.LatLngPopup()
(1) 지도를 마우스로 클릭했을 때 위도, 경도 정보를 반환
범죄 6
웹데이터 1
p 태그 확인
(1) soup.p
(2) find( )
(3) 처음 발견한 p 태그만 출력
(4) 찾고 싶은 태그 확인
soup.find("p", class_="inner=text first-item")
soup.find("p", {"class":"outer-text first-item"}).text.strip( )
(5) 여기서 strip( )은 공백을 지워준다.
다중 조건
soup.find("p", {"class":"inner-text first-item", "id":"first"})
find_all( )
(1) 여러 개의 태그를 반환
(2) list 형태로 반환
(3) soup.findAll("p")도 가능하다.
특정 태그 확인
(1) soup.findAll(id="pw-link")[0].text
p 태그 리스트에서 text 속성만 출력
(1) for문
for each_tag in soup.findAll("p"):
print("=" * 50)
print(each_tag.text)
a 태그에서 href 속성값에 있는 값 추출
(1) links = soup.findAll("a")
(2) links[0].get("href"), links[1]["href"]