Most voted "php-domxpath" questions
7 questions
Sort by count of
-
5
votes5
answers446
viewsHow can I capture a favicon from a site via PHP?
I upload an external content from a website and then import it to the DOMDocument. Currently, I can capture tag information title easily. I do so: $dom = new DOMDocument();…
-
3
votes2
answers726
viewsDomxpath query with multiple classes
I’m performing a parse on a file html with the following structure : <div class="lstImv blackBd12"> <div class="stCl3 stLeft imvImg"> <div class="imgBox"> <a…
-
2
votes1
answer67
viewsIs it possible to get the value of the background-image attribute through xpath?
I have the following structure: <div class="xGh" style="background-image: url('name_file.jpg');"></div> Where I need to capture: name_file.jpg I tried to use the solution presented in…
-
1
votes1
answer89
viewsDomxpath find element with exact name
I’m having a problem trying to find an element with the exact name. <? //... @$DOM = new DOMDocument; @$DOM->loadHTML($html); @$finder = new DomXPath($DOM);…
-
1
votes0
answers24
viewsSelect text from a div and ignore any other tag using Xpath
I have the following situation where I want to get the text from a div and ignore the contents of the daughters Divs and get only the text from the parent div below follows the html structure.…
-
0
votes1
answer50
viewsHow to iterate to get all results of xpath->evaluate
In general to iterate elements xpath I use a loop as follows: <?php $dom = new DOMDocument; $dom->loadHTML('<div class="xGh">Test1</div><div…
-
0
votes1
answer88
viewsHelp to transform a for each ( from a php file_get_contents ) into Json Encode
to performing a file_get_contents php on a site, ai shows all teams of this site, in the for each loop it shows me all the time ( that are between the file tags ), but wanted to turn all these teams…