이 코드에서 전화 번호를 얻으려면 어떻게해야합니까?이 코드 유형에서 문자열 가져 오기
<div class="fl contact_item notLast">
<div class="grayPhone sprite-grayPhone fl icnLink"></div>
<div class="fl">
<script>
...
</script>1 (877) 530-0360
</div>
</div>
나는이 코드로 성공을 거뒀습니다.
if($(pageDetailsSecond).find('div.grayPhone > div.fl').length) {
var card_Phone = $(pageDetailsSecond).find('div.grayPhone').text(); }
else { var card_Phone = ''; }
누구나 나를 도와주세요.
감사합니다. 잘못된 사업부에서 찾고
귀하의 코드는 전화 번호가 내부 즉'grayPhone' –
클래스와 일 안에 아이'div'이 없었'div.fl'가 아닌'div.grayPhone' – techfoobar
는 항상 DOM 구조는 유사하다? – scunliffe