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

How can I parse this PARTICULAR HTML table into a php array?

Possible Duplicate: How to parse and process HTML with PHP? How to parse HTML with PHP? http://www.nfl.com/widget/gc/2011/tabs/cat-post-boxscore?gameId=2012093000 I am looking to scrape the data from pages like the link above (that is, game level…
Dedwards
  • 73
  • 3
  • 7
0
votes
1 answer

Replace the array values using Preg_replace in PHP with simple HTML DOM?

we are working on a project, in which we have to replace html data with array values using PHP preg_replace() please look at the codes Codes $html = new simple_html_dom(); $texts = array('Replace','the',…
Sam
  • 53
  • 1
  • 2
  • 9
0
votes
1 answer

simple html dom and parsing table

I have to parse 2 kind of table one is this http://leghe.fantagazzetta.com/f12-13/ ("Classifica Generale") and the other two table are here http://leghe.fantagazzetta.com/f12-13/formazioni?id=30339&g=4 how can i extract this data to an array? for…
Matteo
  • 171
  • 1
  • 5
  • 15
0
votes
2 answers

Group parser of a html page

the html page :
rosen_
  • 248
  • 1
  • 3
  • 12
0
votes
2 answers

Attempting to load again a URL when it fails

The following function receives a string parameter representing an url and then loads the url in a simple_html_dom object. If the loading fails, it attemps to load the url again. public function getSimpleHtmlDomLoaded($url) { $ret = false; …
rfc1484
  • 9,441
  • 16
  • 72
  • 123
0
votes
2 answers

Node of Dom Parser to get title from a html page

this the html page:

[BOOK] [B] Title

rosen_
  • 248
  • 1
  • 3
  • 12
0
votes
2 answers

Error handling loading a URL

I'm using a library called Simple HTML DOM One of it's methods, loads the url into a DOM object: function load_file() { $args = func_get_args(); $this->load(call_user_func_array('file_get_contents', $args), true); // Throw an error if we…
rfc1484
  • 9,441
  • 16
  • 72
  • 123
0
votes
1 answer

get text inside single
tag simpleHTMLDOM PHP

I am trying to get text from an html file using the simplehtmldom lib for PHP. I only want the text after the
tag (TextAfterBreak) but only know how to get the entire text between the tags (TextInsideFontTextAfterBreak in this…
wandersolo
  • 69
  • 1
  • 3
  • 11
0
votes
1 answer

Call to a member function find() on a non-object when inserting data using PHP mySQL simpleHTMLDOM

I have a script that parses certain elements from a webpage and stores them in a mysql db. Everything works fine until I try to split an element and store the resulting data into the db. Any ideas what might be wrong? Here's the page I'm parsing:…
wandersolo
  • 69
  • 1
  • 3
  • 11
0
votes
4 answers

PHP Simple HTML Dom not Working fine

Here is my code: include('simple_html_dom.php'); $page = file_get_html($_REQUEST['url']); $page = $page->find('table[class=cf-table-style sorted]',0)->find('tbody',0); echo ($page); echo $page is suppose to print HTML but it prints a Array, which…
Wasim A.
  • 9,660
  • 22
  • 90
  • 120
0
votes
1 answer

Simple HTML DOM Parser and a for each loop

I am using PHPCRAWL and SIMPLEHTMLDOMPARSER to get some data from a public website. It has taken me forever to figure this out, but now I have another question that I am lost on. Using the code below I can get the $first item for each page, but…
0
votes
3 answers

Scraping with simple_html_dom

I am trying to scrape this: Site1 Text1
Text2
I get get to pa1 easily..but I want to get to the two fonts that come after.. So I used this: $html = new…
Dmitry Makovetskiyd
  • 6,942
  • 32
  • 100
  • 160
0
votes
0 answers

Get html dom - Why "html_simple_dom" find page and "cURL" not?

For some reason, some times with cURL find the pages but not other times, instead simple_html_dom find the page with same url. For example: $url = http://www.youtube.com/results?search_type=search_users&search_query=java&page=7 with cURL the page…
Donovant
  • 3,091
  • 8
  • 40
  • 68
0
votes
1 answer

php page scraping task

I use Simple HTML DOM library in my Drupal custom module to do a task in my project. The task simply is imitating the Facebook action, when we paste an article url, FB scrap the url and return back with part of the article as a description and an…
Ahmed
  • 37
  • 10
0
votes
1 answer

Simple html dom parser can`t parse all page

I need to get info from the center column of that site (I need phone numbers exactly) I`m using SimpleHTML dom parser, and was trying some curl method, but it always gives me html source without that central column ! I understood that using this…
Trimod
  • 114
  • 1
  • 5
1 2 3
99
100