simple-html-dom

How do you search by the contents of a tag in simplehtmldom?

Hi, I am trying to write a web scraper using simplehtmldom. I want to get a tag by searching the contents of the tag. This is the plaintext inside it, not the type of tag. Then once I have the tag by searching for the contents of its plain text I want to get the next tag after that. How do I find a tag based on its contents? And on...

Can't separate cells properly with simplehtmldom

I am trying to write a web scraper. I want to get all the cells in a row. The row before the one I want has THOROUGHBRED MEETINGS as its plain text value. I can successfully get this row. But I can't figure out how to get the next row's children which are the cells or <td> tags. if ($foundTag = FindTagByText("THOROUGHBRED MEETINGS",...

simple_html_dom - problem not covered in manual

hello I am searching for all instances of tags with the EXACT class "hello" using simple_html_dom foreach($html->find('.hello')as $found The above doesn't quite do this because it also gives me classes like "hello world". It is simple yes to count through and list the correct element from the array but the source html that is being pa...

Extract doctype with simple_html_dom

Hi am using simple_html_dom to parse some website. Is any way to extract the doctype? Thanx, Granit ...

PHP Command-line scripts are ignoring php.ini and ini_set('memory_limit',...) directives.

Hello, I am facing the common "Fatal error: Out of memory (allocated 30408704) (tried to allocate 24 bytes)..." PHP Fatal error. Pages served via Apache are not exhibiting this behavior. I've tried the following: Increasing the memory_limit in php.ini to a much larger value. Increasing memory_limit within the script itself via calls t...

Simple HTML DOM help

How can I extract the value attribute of an input tag? Using SIMPLE HTML DOM let me give you an example: <form action="#" method="post" name="test_form" id="test_form"> Name<input type="text" name="name" value="NaMe"/><br /> Address<input type="text" name="address" value="AdDrEsS"/><br /> <input type="hidden" value="sayantest" /> </fo...

Parse php array

Im using a class that returns a rather large (I guess) array. How do I get the value of the div's class attribute - in this array its 'display:none' - Its the output from a print_r. Here is the array: http://joe-riggs.com/large%5Farray.php Also the class I'm using that is returning this array is simplehtmldom_1_11 - so there may be a ...

Removing nested tags with simpleHTML

I'm trying to use simple_html_dom to remove all the spans from a snippet of HTML, and I'm using the following: $body = "<span class='outer' style='background:red'>x<span class='mid' style='background:purple'>y<span class='inner' style='background:orange'>z</span></span></span>"; $HTML = new simple_html_dom; $HTML->load($body); $spans...

How to get Content-type using html simple dom?

I tried find('meta[http-equiv="Content-type"]') but it failed to retrieve that information. ...

<tbody> 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 <tbody> tag. The structure of the table is, essentialy (details aren't really that important): <table> <thead> <!--text here--> </thead> <tbody> <!--text here--> </tbody> </ta...

PHP Simple_html_dom issue

The snippet below loops through some web pages, grabs the html and then looks for table.results and gets the plaintext out of the tags contained in each . $result is ok. Now I'm trying to get the href value of an tag that is found in the second of each . I'd like to include this in the $results array, but I'm not sure how to do this....

Using Simple_Html_Dom Find with 2 attributes

Hey, Does anyone know how i could use simple_html_dom's find function to find an html element specifying 2 attributes instead of 1? Like right now I was using $area2 = $html->find('td[width="450"]'); but say I want to also specify the height for the object, etc How could I do it? Thanks! ...

Looking for java html parser like simple html dom in PHP

Hi, I am Looking for java html parser like (I know java well vs my bad php - in this way i want understand how html parser works) simple html dom in PHP. thanks ...

How should parse with PHP (simple html dom parser) background images and other images of webpage?

Hi, How should parse with PHP (simple html dom/etc..) background and other images of webpage? case 1: inline css <div id="id100" style="background:url(/mycar1.jpg)"></div> case 2: css inside html page <div id="id100"></div> <style type="text/css"> #id100{ background:url(/mycar1.jpg); } </style> case 3: separate css file <div i...

PHP- HTML parsing :: How can be taken charset value of webpage with simple html dom parser?

Hi, PHP:: How can be taken charset value of webpage with simple html dom parser (utf-8, windows-255, etc..)? remark: its have to be done with html dom parser http://simplehtmldom.sourceforge.net Example1 webpage charset input: <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> result:utf-8 Example2 webpage ch...

Problem with Simple_HTML_DOM cutting of in PHP

I am trying to use simple_html_dom to extract some data from a website. Unfortunately somehow in the middle of the data to be analyzed it cuts off a part which means the data that I want to extract is or is not part of the string that I can analyze. This is my code: <?php include_once('../../simple_html_dom.php'); function mouser(...

Help for PHP newbie in results indexing using PHP

I am trying to create a multithreaded PHP script that POSTs the USN (University Seat Number) to the university results website and then indexes the result. Please give me the plot to do so. I started learning PHP a month ago. please do read the following: Valid USN regex is /^([12347]{1})([a-zA-Z]{2})([0-9]{2})([a-zA-Z]{2})([0-9]{3})$/...

Filter a Simplehtmldom result

Hi! First, sorry for poor title... I'm working to get some text out of another page and I got one step working by narrow down the source but I have trouble narrow it down more. My code: <?php include('simple_html_dom.php'); $html = file_get_html('https://www.*.org/sok/quote=*'); echo "<b>find all div tags with posts id</b><hr>"; fo...

CakePHP: Embed CTP filename and path in views and elements

I'm looking for an elegant way to make a bit of jquery aware of the filename and path of the ctp file containing a given dom selection. I'm using simple_html_dom to write changes to template flies via an ajax call. I need to provide the filename and path of the view or element template ctp file that contains the dom element I've selected...

simple html dom - cannot redeclair str_get_html()

Hi, Im trying to make a class to help with SEO and also compare google API with actual results class: <?php class true_seo { public $string, $amount; private $arr; public function __construct(){} public function set_g_key( $key ) { $this->g_key = $key; } public function set_phrase( $string )...