PHP dom to get tag class with multiple css class name

后端 未结 2 912
谎友^
谎友^ 2020-12-12 02:01

I have difficulties to get second link href and Text. How to select class=\"secondLink SecondClass\". Using PHP Dom, Thank you

        

        
相关标签:
2条回答
  • 2020-12-12 02:34

    you can pick it by selecting your td having class pos and selecting anchor tags. then you cann control your returing array to get your specific anchor tag

    0 讨论(0)
  • 2020-12-12 02:42
     $hrefs = $xpath->evaluate("/html/body//a[contains(concat(' ',@class,' '),' secondClass ')
              and (contains(concat(' ',@class,' '),' secondLink '))]"
    

    from this answer

    0 讨论(0)
提交回复
热议问题