0
현재 Scrapers 용 코드를 작성하고 있으며 점점 더 파이썬의 팬이되고 특히 BeautifulSoup가됩니다.BeautifulSoup - Python에서 동일한 태그를 건너 뛰는 방법
아직도 ... html을 통해 구문 분석 할 때 나는 그렇게 아름다운 방법으로 만 사용할 수있는 어려운 부분을 발견했습니다.
나는 HTML 코드 특히 다음 코드 긁어하려면 :
<div class="title-box">
<h2>
<span class="result-desc">
Search results <strong>1</strong>-<strong>10</strong> out of <strong>10,009</strong> about <strong>paul mccartney</strong><a href="alert/settings" class="title-email-alert-promo x-title-alerts-promo">Create email Alert</a>
</span>
</h2>
</div>
을 그래서 내가 사용하여 DIV를 식별하는 것입니다 무엇을 :.
comment = TopsySoup.find('div', attrs={'class' : 'title-box'})
그런 추악한 부분에 제공을하는 방법 내가 가지고 할 번호를 잡을 : 10009를 내가 사용 : 더 좋은 방법이 있는지
catcher = comment.strong.next.next.next.next.next.next.next
누군가가 말해 줄래?