0
클래스 HREF 태그에서 데이터 추출 : HTML에서 http://www.ipeen.com.tw/search/all/000/0-100-0-0/%E4%B8%AD%E5%BC%8F/?adkw=%E5%8F%B0%E5%8C%97<웹 긁어 파이썬>이 사이트 파이썬/BeautifulSoup로 스크랩을 사용하려면
홈페이지 질문은 어떻게 추출하는 것입니다 "/ 숍/1057970- 麻辣 公館" 같은 이 :
:<h3 class="name" id="shop_h3_">
<a class="a37 ga_tracking" data-action="ad_shop" data-category="search" data-label="店名" href="/shop/1057970-麻辣公館" target="_blank">麻辣公館</a>
<span class="markVip">合作店家 <a class="joinVip ga_tracking" data-action="ad_shop" data-category="search" data-label="如何刊登" href="http://www.ipeen.com.tw/ad/adipeen.php?id=b31149405ef268fe0b2dd035f450000e">(如何刊登?)</a></span> </h3>
<div class="serPic">
<div class="align">
<span></span>
<a href="/shop/1057970-麻辣公館" target="_blank"><img alt="麻辣公館" class="lazy" src="http://iphoto.ipeen.com.tw/photo/ipeen/140x140/vip/0/7/9/store_1057970/sp1057970_20160416132749762.jpg" title="麻辣公館"/></a>
</div>
</div>
은 하나는 아래에있는 내 코드입니다3210
url ='http://www.ipeen.com.tw/search/all/000/0-100-0-0/%E4%B8%AD%E5%BC%8F/?adkw=%E5%8F%B0%E5%8C%97'
opener=urllib.request.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
page = opener.open(url)
soup = BeautifulSoup(page)
soup.find_all('a', {'class':"a37 ga_tracking"})
은 몇 가지 가능한 아이디어를 덕분에 많이주세요!
안녕하세요 : 둘 이상의 링크를 원하는 경우,
또는 : 그냥 사용할 필요가! 그러나 단지 '''javascript : void (0); ' ''' 실행은 '''soup.find ('A', { '클래스': "A37 ga_tracking"}) 동안 [ 'HREF는'] ''' –
어쩌면 '''수프 같은 STH이다 .find_all ('a', { 'class': "a37 ga_tracking"}) ''' ? –
but this this soup.find_all ('a', { 'class': "a37 ga_tracking"})] 태그의'''[tag [ 'href']] ''' 좋은 작품! 덕분에 ! @Fejs –