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
0
votes
1 answer

Scraping & Returning JSON data php

I currently have a script, Can be found here: http://ddelay.co.uk/bus/find_services2.php With the following code:
Damien D
  • 19
  • 9
0
votes
1 answer

Adding a comment with SimpleDOM using xpath

I'm trying to add a comment in a xml file to a specific element, every element has it's unique names. My file is a translation file so it only contains string-elements and plurals etc. Here's the snippet I use for my first attempt to add a…
Leo Pflug
  • 544
  • 3
  • 15
0
votes
0 answers

How to retrieve a script tag source content?

I have a small problem with my code..I accessed the src value in the script tag to get the content of the JavaScript page that is found at the server side..It is ok as i get what i wanted but the problem is that i am getting the html code also..I…
Johnson Smith
  • 55
  • 1
  • 1
  • 7
0
votes
1 answer

simple html dom check if file is found

I've been up for hours now researching error handling with simple_html_dom it's for a vine filter website. I need to make it so that if $videoid has no string content it will either A. End simple_html_dom and output a normal string like "no content…
0
votes
2 answers

Extract DIV from XHTML with simpleHTMLDom and then print out

Task - scrape content inside a DIV tag with an ID and then return the XHTML. I am using 'PHP Simple HTML DOM Parser' Example simplified code:

Head

Section…

mjpg
  • 23
  • 5
0
votes
1 answer

PHP Simple DOM find not working

This had me stuck for a while so I thought I would post it. My issue was that my find-> was not working correctly and $product_name was coming up null require 'mysql_con.php'; require 'simple_html_dom.php'; $html =…
Melbourne2991
  • 11,707
  • 12
  • 44
  • 82
0
votes
1 answer

Why doesnt this simple dom work?

I am trying to get all the image src's and rename the files using this code but it doesnt seem to work. Any ideas ?? require_once('catalog/controller/forum/simple_html_dom.php'); $test = $data['description']; $html =…
0
votes
2 answers

How can I sort on XML child node value with PHP SimpleDOM? (or any other method)

I need to sort the following XML (foreach ProgramList) based on the value of it's child MajorDescription
tsdexter
  • 2,911
  • 4
  • 36
  • 59
0
votes
1 answer

How to Find all internal elements using Simple Php Dom?

We are looking to view and modify the particular element using Simple PHP DOM, load_file('http://www.google.com'); foreach ($tags…
Sam
  • 53
  • 1
  • 2
  • 9
0
votes
1 answer

Simple Dom Parser get span values in Table

I am using Simple DOM Parser and I am trying to get some info from a dynamic table that will look like this:
5 star
Nick
  • 9,285
  • 33
  • 104
  • 147
0
votes
3 answers

Why does PHP's cURL appear to 'timeout' on certain URLs?

I'm using PHP's cURL to get some tag information from various URLs. My requests work some of the time, but other times they don't work at all. Is there some reason why my code doesn't work? (Note that I'm also using simple_html_dom): $webpage =…
Ajay Mohite
  • 119
  • 3
  • 13
0
votes
1 answer

How can I get the nearest img tag to an h1 tag using PHP simple HTML DOM?

I have code that gets the first h1 tag from a webpage. Now I want to get the first img tag that appears either before or after this h1 tag. How can I do this using PHP Simple HTML DOM?
Ajay Mohite
  • 119
  • 3
  • 13
0
votes
1 answer

Why is PHP Simple HTML DOM Parser unable to capture the contents of a tag from certain URL's?

I'm using PHP Simple HTML DOM Parser to get the contents of the first

tag on different webpages. The script works great most of the time, but on some webpages my script just kind of 'hangs up'. The script stops, without completing the code that…

Ajay Mohite
  • 119
  • 3
  • 13
-1
votes
1 answer

PHP html simple dom parser returns null

I'm trying to parse some table data, but that table doesn't have class or fixed number so i'm trying to catch it by using the next_sibling() method. But if I find a standard table it returns null. Did I make a mistake in my code?
whtjs
  • 49
  • 6
-1
votes
1 answer

PHP simpleDOM nested find

As en exercise to learn php, I'm working on stripping some info from a local events site. One of the fields isn't behaving, and I feel like I'm conceptually off track. Could someone walk through how you'd extract just the time from the following…
benrules2
  • 417
  • 4
  • 14