작동하지 그것에 기호는 CSS 선택기를 사용하여 .간단한 HTML DOM CSS의 선택은이 코드를 <a href="http://simplehtmldom.sourceforge.net/" rel="nofollow">http://simplehtmldom.sourceforge.net/</a></p> <p>에 참조
그러나 아무 것도 반환하지 않습니다.
내 코드가 잘못되었습니다.
작동하지 그것에 기호는 CSS 선택기를 사용하여 .간단한 HTML DOM CSS의 선택은이 코드를 <a href="http://simplehtmldom.sourceforge.net/" rel="nofollow">http://simplehtmldom.sourceforge.net/</a></p> <p>에 참조
그러나 아무 것도 반환하지 않습니다.
내 코드가 잘못되었습니다.
주의 깊게 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"]');
XPath에서 글꼴 항목을 인용하지 않았습니다. find()
호출
$lis = $dom->find('[style=~"font-family:symbol"]');
^------------------^---- missing
HM 나는 $ 할 시도 m-> find ('[style = ~ "font-family : 기호"]'); 아직 아무것도 돌려 보내지 않고있어. – pillarOfLight
이 모든 질문에 대답하지 않습니다, 인라인 스타일보다 CSS 클래스를 사용하는 것이 좋을 것이다 ... –