Questions tagged [simpledom]

A bridge between SimpleXML and the DOM extension, plus a bunch of convenience methods

SimpleDOM is built upon SimpleXML and acts as a bridge providing DOM methods using SimpleXML's syntax. It also adds a bunch of convenience methods.

SimpleDOM is a single file with no dependencies. All you need to use it is include it and create SimpleDOM objects instead of SimpleXMLElement objects, or simply use simpledom_load_string() instead of simplexml_load_string().

URL: http://code.google.com/p/simpledom/

77 questions
1
vote
1 answer

How does one use SimpleDOM sortedXPath to sort on node value?

XML newbie here! I have a file containing only the following XML: orange apple banana I want to ouput the tags alphabetically. I am trying to use SimpleDOM library and its sortedXPath method.…
Kerans
  • 115
  • 1
  • 17
1
vote
1 answer

How can I sort XML nodes on multiple attributes using SimpleDom sortedxpath?

I'm using the SimpleDom library and need help with the sortedxpath function. Here's the XML John Bday
Kerans
  • 115
  • 1
  • 17
1
vote
2 answers

PHPHtmlParser - $dom->find() only returning first result

I am using the php-html-parser package (based simplehtmldom) loaded in via Composer and parsing an HTML string, however when using the $dom->find() to loop through all of the elements I am searching for, it is only detecting the first element (out…
Lorenzo Aiello
  • 497
  • 1
  • 7
  • 18
1
vote
1 answer

Simple HTML DOM code issue

I'm working on a page that gets html div code to my website page and displays on the website. My code goes like this: require './simpledom.php'; $url = 'https://cit2.net/index.php?topic=75443.0'; $html = file_get_html($url); if (!empty($html))…
1
vote
1 answer

get span content text using simple DOM parser php

I have following div,
Review Status: Active | Order #: 22436 |…
1
vote
2 answers

remove the blank rows after i removed xml elements?

i removed some elements from a xml file with simpledom. the code: $this->xmlDocument->removeNodes("//entity[name='mac']"); here is the initial file: apple category
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
1
vote
1 answer

extract div class simple dom

So I have a data structure that looks like this:

VIN: 1J8FA24177L168628

1BE95XXXAD
FRONT BUMPER: Dam
MrTechie
  • 1,797
  • 4
  • 20
  • 36
1
vote
1 answer

insert div between content using foreach with simple html dom parser

I'm using PHP simple dom parser, says my markup is like this ..
..
..
I tried $banner = '
blablabla
'; foreach($html->find('tb') as $table){ $table->outertext .=…
user3522725
  • 387
  • 1
  • 4
  • 13
1
vote
1 answer

php simple DOM parser

ok so i have been battling with this for a while now so maybe someone can help me. Im trying to get the email link from this HTML:
E-mail
1
vote
1 answer

Simple Dom Parser - stripping links and specific divs from the result

I am trying to parse some content from a specific div and save it to an external file. Although this works, I couldn't manage to do the following From the div with class league_container remove all divs with the class bar strip all links. (leave…
1
vote
4 answers

PHP Simple HTML DOM Parser returns gibberish

$html = file_get_html('http://www.livelifedrive.com/'); echo $html->plaintext; I've no problem scraping other websites but this particular one returns gibberish. Is it encrypted or something?
Paul Jones
  • 35
  • 3
1
vote
2 answers

Simple dom to find out image url

I have an index.html code like this
image
and I use this code to findout the image url (http://host.com/images/image-name.jpg)
Phuc Khung
  • 29
  • 1
  • 6
1
vote
3 answers

How can I use PHP Simple HTML DOM to get the contents of a tags attribute?

I want to get the contents of the src attribute of an tag. Here is the code I'm using: require_once( 'simple_html_dom.php'); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $webpage); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); …
Ajay Mohite
  • 119
  • 3
  • 13
1
vote
3 answers

Simple DOM and Sony.co.za?

I have been running my simple dom script on a variety of pages for weeks, and never have I come across any issues. Now, today, when I try: $html = file_get_html('http://www.sony.co.za/product/dsc-wx10'); I get: ( ! ) Warning:…
rockstardev
  • 13,479
  • 39
  • 164
  • 296