html php get dom table - can't extract table data -
I'm trying to remove two tables when using Get HTML DOM, Can not do to get the information, only what I am getting on the following web page:
Can you help in whatever you are doing wrong? The following PHP code is in use
& lt ;? Php // How to use basic selector to retrieve HTML content for example ('../ simple_html_dom.php'); // Get from the DOM URL or $$ html = file_get_html ('http://www.lolking.net/now/euw/tallmangreen/'); // Find all links // foreach ($ html- & gt; ('a') $ e) // echo $ e- & gt; Href '& lt; Br> & # 39; & # 39; // Find All Image Foreign Currency ($ HTML- & gt; Find ('IMG' as $ E) echo $ e- & gt; Src '& lt; Br> & # 39; & # 39; // Find all images in the form of $ E as full tag foreign currency ($ html-> search ('IMG') echo $ e- & gt; External Text '& lt; Br> & # 39; & # 39; Find all div tags for $ e with id = gbar foreach ($ html- & gt; search ('div # gbar') e $ e- & gt; innertext '& lt; br & gt;'; // Find all e-span tags with class = GB1 foreign currency ($ html-> search ('span.gb1') $ e) echo $ e-> External text '& lt; br & gt;' ; // Mill Table - $ e in my form of editing foreach ($ html- & gt; Mill ('table.purple- team lknow- team-table TD') echo $ e- & gt; innertext '& lt; Find all TD tags with the '; // attribite align = center foreach ($ html- & gt; search (' td [align = center] ') $ e) echo $ e-> innertext' & amp; Retract text from lt; br & gt; '; // table Win $ html- & gt; Search ('td [align =' center ']', 1) - & gt; plain text. & Lt; br & gt; & lt; hr & gt; '; // html To remove the text from $ html- gt; plain text;? & Gt;
The selector you use is not correct. This statement will not check 2 squares on the element table
foreach ($ html-> $ (e)) ('table.purple -team lknow-team-table td ')) Correct foreach ($ html-> Search ($ e) in the form of 'table [class = purple-team lknow-team-table] td') I saw this code at the end of the TD tag at the end and completed The table was found back.
Comments
Post a Comment