<div class="notes module" role="complementary">
<h3 class="heading">Notes:</h3>
<ul class="associations">
<li>
Translation into Русский available:
<a href="/works/494195">Два-два-один Браво Бейкер</a> by <a rel="author" href="https://stackoverflow.com/users/dzenka/pseuds/dzenka">dzenka</a>, <a rel="author" href="https://stackoverflow.com/users/La_Ardilla/pseuds/La_Ardilla">La_Ardilla</a>
</li>
</ul>
<blockquote class="userstuff">
<p>
<i>Warnings: numerous references to and glancing depictions of combat, injury, murder, and mutilation of the dead; deaths of minor and major original characters. Numerous explicit depictions of sex between two men.</i>
</p>
</blockquote>
<p class="jump">(See the end of the work for <a href="#children">other works inspired by this one</a>.)</p>
</div>
출처는 다음과 같습니다.보기 원본 : http://archiveofourown.org/works/180121?view_full_work=true
삭제하려는 요소를 찾아서 인쇄하는 데 어려움을 겪고 있습니다. 지금까지 나는 가지고있다 :
import urllib.request, urllib.parse, urllib.error
from lxml import html
from bs4 import BeautifulSoup
url = 'http://archiveofourown.org/works/180121?view_full_work=true'
html = urllib.request.urlopen(url).read()
soup = BeautifulSoup(html, 'lxml')
removals = soup.find_all('div', {'id':'notes module'})
for match in removals:
match.decompose()
그러나 제거는 빈 목록을 반환한다. 내가 위에서 선택한 모든 div 엘리먼트를 선택하여 html에서 이러한 모든 엘리먼트를 선택하고 제거하도록 도울 수 있습니까?
감사합니다.
감사합니다. 그래도 여전히 빈 목록을 얻고 있습니다. – SBlack