를 사용하여 긴 태그에서 일부 텍스트를 얻기 위해, 나는 다음과 같이 HTML 코드에서 한 brandname 및 제품 이름을 추출 할 :는 어떻게 쇼핑 웹 사이트를 공부하고있다 BeautifulSoup로
<h1 class="product-name elim-suites">Chantecaille<span itemprop="name" >Limited Edition Protect the Lion Eye Palette</span></h1>
results = soup.findAll("h1", {"class" : "product-name elim-suites"})[0].text
을 얻은 : 나는 시도 당신이 볼 수 있듯이 u'ChantecailleLimited Edition Protect the Lion Eye Palette'
는, 샹트 칼리는 한 brandname이며, 나머지는 제품 이름이지만, 그들은 이제 서로 어떤 제안에 잘 접착된다? 고맙습니다!
는 문자열을 사용 .contents''또는''대신 .text'의 .strings' 후 접합하려고/questions/16121001/suggestions-on-get-text-in-beautifulsoup) – bunji