2014-04-09 6 views

답변

1

주의 깊게 the doc을 읽어 보시기 바랍니다해야 ... 사용 가능한 속성 필터는 다음과 같습니다

+--------------------+----------------------------------------------------------------------------------------+ 
|  Filter  |          Description          | 
+--------------------+----------------------------------------------------------------------------------------+ 
| [attribute]  | Matches elements that have the specified attribute.         | 
| [!attribute]  | Matches elements that don't have the specified attribute.        | 
| [attribute=value] | Matches elements that have the specified attribute with a certain value.    | 
| [attribute!=value] | Matches elements that don't have the specified attribute with a certain value.   | 
| [attribute^=value] | Matches elements that have the specified attribute and it starts with a certain value. | 
| [attribute$=value] | Matches elements that have the specified attribute and it ends with a certain value. | 
| [attribute*=value] | Matches elements that have the specified attribute and it contains a certain value. | 
+--------------------+----------------------------------------------------------------------------------------+ 

따라서 귀하의 경우에, 당신은 시험 다음과 같은 예를 들어, 마지막 하나를 [사용할 수 있습니다 그리고] 작동이 비록

$lis = $dom->find('[style*="font-family:symbol"]'); 
+0

허. 그래서 실제로'~ = 'selector를 지원하지는 않는다. ([! attribute]와'! ='와 같은 비표준 인자를 지원한다. 그것은 기괴합니다. 공정하기 위해서, Simple HTML DOM에 대한 문서는 짜증 난다. 나는 문서를 다시 본 후에이 테이블을 어디에서 발견했는지 아직도 알 수 없다. – BoltClock

+0

@BoltClock'HTML 요소를 찾는 방법?'>'속성 필터' – Enissay

0

XPath에서 글꼴 항목을 인용하지 않았습니다. find() 호출

$lis = $dom->find('[style=~"font-family:symbol"]'); 
          ^------------------^---- missing 
+0

HM 나는 $ 할 시도 m-> find ('[style = ~ "font-family : 기호"]'); 아직 아무것도 돌려 보내지 않고있어. – pillarOfLight

관련 문제