2016-07-05 6 views
0

저는 이것을 풀려고합니다. 추출물이 완벽하게 작동하지만 결과는 다음과 같습니다추출 클래스 전용 텍스트

"DIV 클래스 ="ppl_product_header "" "H1"메모리 4 기가 DIMM 2133 MTS CL15 "/ H1" "/ DIV"

하지만, 나는 "h1"과 "h1"사이에있는 것만 필요합니다. 즉 텍스트 만.

from bs4 import BeautifulSoup 
import urllib2 
import time 
y=0 
url ="http://www.grupccccco.com.ar/PROcccO/PcccD_ID=3704444/Distrfffdora.aspx" 
html_page = urllib2.urlopen(url) 
soup = BeautifulSoup(html_page) 
x=soup.find_all('div', class_='ppl_product_header') 
print x 

print "good bye" 
+0

"= < or > ....... –

+0

사용'인쇄 x.text' –

답변

0

사용 get_text(), 귀하의 경우 - print x.get_text()