Questions tagged [simple-html-dom]

Simple HTML DOM is an open source HTML DOM parser written for PHP5+ which lets users easily manipulate HTML.

PHP Simple HTML DOM Parser is an open source project created by S.C. Chen, based on the HTML Parser for PHP 4. It's a PHP 5+ HTML DOM parser class which helps with HTML elements manipulation.

The parser is not limited to valid HTML and can also parse HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to what is possible with .

Elements can be targeted with simple selectors. DOM elements can also be added, deleted or altered. Simple HTML DOM is appropriate for simple tasks but lacks support for many CSS selectors and leaks memory (see manual).

More information on the SourceForge project's page.

1672 questions
38
votes
11 answers

Simple HTML Dom: How to remove elements?

I would like to use Simple HTML DOM to remove all images in an article so I can easily create a small snippet of text for a news ticker but I haven't figured out how to remove elements with it. Basically I would do Get content as HTML…
kasakka
  • 838
  • 1
  • 10
  • 14
20
votes
7 answers

file_get_contents(): stream does not support seeking / When was PHP behavior about this changed?

When was PHP behavior about this changed? From which PHP version is it? Warning: file_get_contents(): stream does not support seeking in /simple_html_dom.php Warning: file_get_contents(): Failed to seek to position -1 in the stream…
re1
  • 435
  • 1
  • 7
  • 17
17
votes
3 answers

PHP HTML DOM Parser

Possible Duplicate: How to parse and process HTML with PHP? I'm looking into HTML DOM parsers for PHP. I've found PHP Simple HTML DOM Parser. Are there any others I should be looking at?
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
16
votes
4 answers

Simple html dom parser return error 500

I am using simple_html_dom.php library from this example http://nimishprabhu.com/top-10-best-usage-examples-php-simple-html-dom-parser.html But i got error 500 inside class, when I type url in browser it works ok? I have some vaules in array like…
Miomir Dancevic
  • 6,726
  • 15
  • 74
  • 142
13
votes
3 answers

How to use file_get_contents or file_get_html?

I've read through quite a few questions on here and I'm not sure if I should be using file_get_contents or file_get_html for this. All that I'm trying to do is use PHP to display the two tables from this page on my website: …
user2087872
13
votes
4 answers

php simple html dom parse img html5 attributes?

How to use simple html dom parse img html5 attribute: data-original $htmls = 'Nubifragio a Verbania , ferite 2 turiste  Gravi danni, chiesto stato di calamità    foto
Giberno
  • 1,323
  • 4
  • 17
  • 31
12
votes
2 answers

jsoup second element instead of first()

I have translated the PHP Simple HTML DOM query: $article->find('td[id$=tdDescription] div a', 1)->plaintext; to the jsoup query: resultRow.select("td[id$=tdDescription] > div > a").first().text()); as you can see I am acessing the second (1)…
Dominik
  • 4,718
  • 13
  • 44
  • 58
12
votes
4 answers

PHP Simple HTML DOM Parser: Select only DIVs with multiple classes

I was searching like mad and found no solution. The problem is simple. Let's say I have 3 DIVs:
TEXT1
TEXT2
Chris
  • 123
  • 1
  • 1
  • 5
12
votes
3 answers

str_get_html is not loading a valid html string

I receive an html string using curl: curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $html_string = curl_exec($ch); When I echo it I see a perfectly good html as I require for my parsing needs. But, When trying to send this string to HTML DOM…
Dani
  • 121
  • 1
  • 1
  • 4
10
votes
5 answers

Warning: file_get_contents: failed to open stream: Redirection limit reached, aborting

I read over 20 related questions on this site, searched in Google but no use. I'm new to PHP and am using PHP Simple HTML DOM Parser to fetch a URL. While this script works with local test pages, it just won't work with the URL that I need the…
Chandan Mishra
  • 101
  • 1
  • 1
  • 4
8
votes
3 answers

how to print cells of a table with simple html dom

i have this html code. Im using Simple HTML Dom to parse the data into my own php script. …
Andres SK
  • 10,779
  • 25
  • 90
  • 152
8
votes
4 answers

glitch in PHP Simple HTML DOM parser
I'm using PHP Simple HTML DOM Parser to scrape some data of a webshop (also running XAMPP 1.7.2 with PHP5.3.0), and I'm running into problems with
tag. The structure of the table is, essentialy (details aren't really that…
thevoiddancer
  • 385
  • 2
  • 9
8
votes
1 answer

PHP Fatal error: Call to a member function find() on a non-object however my function work

I am getting this error on Line 71 of my code, however the function of this line is executed correctly and it does what I expect it to do. However, I noticed that my error log is full of these lines: [09-Dec-2013 14:54:02 UTC] PHP Fatal error: …
user3080061
  • 83
  • 1
  • 1
  • 7
Name City
Greg House
tag
So I have this .html file that I have to analyze. In that file I have lines like this one:
Francisco Ochoa
  • 1,538
  • 4
  • 19
  • 43
1
2 3
99 100