Ich studiere Crawlen mit Python3. Ich möchte nur Text aus HTML-Code extrahieren.Python3 Codierungsprobleme
ex) in html
<div class='titleArea'>
"~~~~~ text~~~~"
</div>
So schrieb ich diesen Code Text zu extrahieren
title_temp = soup.findAll('div',class_='titleArea')
print(title_temp)
** Ich weiß, dass print (title_temp [0] .text), aber es spielt keine Rolle,
Das Ergebnis ist
Inhalte dieser Abbildung ist
[<div class='titleArea'>
@#$!$^[email protected]#[email protected]^#!$^[email protected]#[email protected]#[email protected]#
</div>]
[<div class='titleArea'>
@#$!$^[email protected]#[email protected]^#!$^[email protected]#[email protected]#[email protected]#
</div>]
*** Der Grund, warum es zwei Liste ist wiederholt.
Ich will diesen Text nicht.
Was soll ich tun?
Ich denke, es ist utf-8 Problem.
richtig?
So
schrieb ich, dass
# -*- coding: utf-8 -*-
aber, gibt es noch keine Wirkung war.
post die URL und Sie Anfrage Code –
Was bedeutet "Ich will nicht zu diesem Text." ? und bitte posten Sie genau welche Ausgabe Sie wollen? –
URL ist http://hri.co.kr/board/reportView.asp?firstDepth=1&secondDepth=1&numIdx=26865 und ich möchte den einzigen '~~~~~ Text ~~~~' der jeweils ist Beitrags-Titel – StackQ