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
0
votes
2 answers

loop through divs and extract text using simplehtmldom

I am using simplehtmldom to grab the html from a site. I then search for all the divs on the page and display the innertext where the word count is greater than 300. To do this I iterate with foreach. $findDivs =…
user1882752
  • 576
  • 1
  • 10
  • 20
0
votes
2 answers

simple_html_dom throws warning

Using simple_html_dom it is only parsing the web page header & then throws an warning; the error log Warning: file_get_contents
Akshan
  • 3
  • 2
0
votes
2 answers

My simple_html_dom script, when loaded in browser, is displaying my PHP code

I'm trying to get the title of a couple Android applications. Here's an example of my code I am using:
Jerome
  • 172
  • 2
  • 10
0
votes
1 answer

PHP simple_html_dom foreach

I'm getting html from different pages ($linkHtml) and want to get elements from those pages. With this I get Fatal error: Call to a member function find() on a non-object. If I move the second foreach out I get the result that I want from one page.…
e.e
  • 85
  • 2
  • 5
0
votes
1 answer

simplehtmldom strange behaviour

I met some strange simplehtmldom behaviour. I get $newlink from some page, then put it into another curl, return blank data. If I change curl_setopt($ch1, CURLOPT_URL, $newlink); to curl_setopt($ch1, CURLOPT_URL,…
yuli chika
  • 9,053
  • 20
  • 75
  • 122
0
votes
3 answers

Scrape Html with by using simple_html_dom.php library

There is an html document with the following format:
I want always to retrieve the second map. However, I want to make completely…
Nick Robertson
  • 1,047
  • 4
  • 18
  • 41
0
votes
2 answers

How to use objects variables (var_dump)?

I just var_dump'ed object and got something like this: object(simple_html_dom)#1 (23) { ["root"]=> object(simple_html_dom_node)#2 (9) { ["nodetype"]=> int(5) ["tag"]=> string(4) "root" ["attr"]=> array(0) { } ["children"]=> array(0) { }…
Jonuux
  • 533
  • 1
  • 7
  • 20
0
votes
0 answers

fetching data from http://api.hostip.info/

Fetch city from this xml document http://api.hostip.info/ so i used html dom parser. if i used gml:name to get city name i got city name as well as host id string. how to get only city name from this site?
Jaydipsinh
  • 491
  • 1
  • 9
  • 27
0
votes
1 answer

json service from data scraping with php

I am trying to figure out what is the best way to make this work, I am new to php. I was able to make my script work to find specific data on my htm file with the following script tested on my local server.
thefern
  • 367
  • 7
  • 19
0
votes
1 answer

php preg_replace html menu, footer

I am tring parse html use simple html and remove page menu and footer (In example, i choose http://codex.buddypress.org/developer-docs/the-bp-global/, and then may be other url.). But my code return Fatal error: Call to a member function find() on a…
fish man
  • 2,666
  • 21
  • 54
  • 94
0
votes
2 answers

Can't cut out specific info using Simple HTML DOM

How do I cut out only the first and in this, but not the second set? I am looking to cut out only the first two tags and contents. Is there a way to set both of these to a variable eg,…
Cully
  • 484
  • 9
  • 19
0
votes
1 answer

How do I separate out these sections? (scraping, but should be simple loops/foreach)

I am using SIMPLE HTML DOM to scrape a website and I'm getting the following code... $GameSummary
Goals scored
Gallas
Cully
  • 484
  • 9
  • 19
0
votes
0 answers

File not getting read using file_get_html

I am using curl to store webpage in txt file and then reading the file to parse its content. For some website its running fine but for some websites it is(file_get_html) returning null. I have checked that txt file is generated with data but it is…
amit surana
  • 49
  • 2
  • 10
0
votes
3 answers

Collecting http-equiv with simple html dom

I am using Simple html DOM to parse different elements from submitted html documents. I have been trying to figure out how to check for the following I have tried to use. foreach($html->find('meta') as…
James
  • 702
  • 2
  • 15
  • 39
0
votes
2 answers

cannot get the exact charset using file_get_html

I'm trying to get details from a website using file_get_html of simple html dom. The link i tried is : http://dns.marnet.net.mk/registar.php?dom=test.mk what i get is full of question marks ������ ������������ ������: test.com.mk test.mk ��������…
hablema
  • 540
  • 1
  • 5
  • 17
1 2 3
99
100