Questions tagged [simpledom]
A bridge between SimpleXML and the DOM extension, plus a bunch of convenience methods
77
questions
0
votes
1
answer
150
views
How can i scrape invalid html using php simple dom?
I'm trying to scrape a webpage using phpsimpledom.
$html = '<div class="namepageheader">
<div class="u">Name: <a href="someurl">Noor Shaad&...
1
vote
0
answers
78
views
PHP scraping information from another URL, Blank page or E_NOTICE : type 8 -- Trying to get property of non-object
basically I'm trying to make a small tracking plugin for my website, and I'm not sure what I am meant to put get the correct name for the element ID. I either get a blank screen or E_NOTICE : type 8 --...
0
votes
1
answer
61
views
How can I randomise User Agent for file_get_html?
I'm scraping a website (nothing dodgy) with simple_html_dom and need to randomise my user agent.
Tried to multiple array content but keep getting the first one.
$opts = array(
'http'=>array(
...
0
votes
2
answers
3k
views
loop through html table and get tr, th and td in php with simple dom parser
I need to get a table with simple html dom parser, clean it (remove attr and spaces), then output it again.
My question is, how can i loop through with PHP and output the TH and TD in one sequence?
...
1
vote
2
answers
1k
views
Simple_Dom Error: file_get_contents(): stream does not support seeking in Laravel
I'm getting a error as below.
file_get_contents(): stream does not support seeking
I installed simple_dom by a composer:
composer require sunra/php-simple-html-dom-parser
and used this too:
...
0
votes
2
answers
99
views
I can't grab specific URL in search page
I enter the estate website and searched by name of the city. After that I want to grab Osaka City building URL. In here http://brillia.com/search/?area=27999 There are four of those.
And I m using ...
0
votes
1
answer
36
views
Get data by sending input to other website using simple dom parser
How can I get response data by sending input value to some website through POST method by using Simple Dom Parser?
For eg, below is the URL and I want to post one data to this URL and I want response ...
0
votes
0
answers
175
views
Retrieve the DOM from a variable with Simple HTML DOM Parser?
I'm using Simple HTML DOM Parser to retrieve informations from a website with this code:
$html = file_get_html("http://www.example.com/"]);
$table = $html->find("div[class=table]");
foreach ( $...
0
votes
1
answer
262
views
Scraping data from a website with Simple HTML Dom
I work to finish an API for a website (https://rushwallet.com/) for github.
I am using PHP and attempting to retrieve the wallet address from this URL: https://rushwallet.com/#...
0
votes
1
answer
217
views
get nested element content with simpleDOM
How do I get ext_link content with simple DOM from the following DOM?
...
<td class="player">
<img src="Web/Images/Players/33/45d5652.png" />
<a class="ext_link" target="_blank" href="...
0
votes
1
answer
33
views
How can I make this PHP DOM parser more efficient with nested arrays?
How can I make this parser more efficient? I feel like these if statements are crazy! I'm thinking that a callback function would be able to get the job done.
However, most of my identifiers are ...
1
vote
0
answers
87
views
Modify DOM and replace mail addresses
I would like to make use of Simple HTML DOM parser to search for mail-adresses in the content of a html-site and replace them.
The replacement contains a span element and a little bit JS (this should ...
0
votes
3
answers
285
views
foreach loop and unexpected else in php when using html dom parser
I have write a code to use html simple dom parser, here it is :
<?php $opts = array( 'http'=>array(
'header'=>"User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) ...
-1
votes
1
answer
291
views
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. ...
-2
votes
2
answers
164
views
PHP SIMPLE DOM PDO select
I have in the database a list of links from which I want to take some data.
All the script is working, except the part when I'm taking the link from the DB and paste it in Simple DOM function.
"
...
1
vote
2
answers
2k
views
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 ...
0
votes
2
answers
377
views
Use simple dom to get select by name
I'm trying to use simple dom to get an element by name
It's to crawl an old website and they only use name
<select name="id_items_1" required="">
<option value="">Seleccione su talla&...
0
votes
1
answer
97
views
HTML Simple DOM result to HTML table
I have a problem with HTML simple DOM. I need get results from parse to HTML table with two columns.
I have following code:
<table>
<?php
$html = '&...
4
votes
1
answer
104
views
simplexml doesnt load <a> tag classes?
I have a bit of php that grabs the html from a page and loads it into a simplexml object. However its not getting the classes of the element within a
The php
//load the html page with curl
$html = ...
2
votes
1
answer
115
views
Foreach explode trim take last date simple dom parser
I want to take only last date from the third div counting from text div, using foreach below is my code
It only shows the date 01.01.1970 i cant get the date and compare it to today dates
--------...
1
vote
1
answer
123
views
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';
$...
1
vote
1
answer
2k
views
get span content text using simple DOM parser php
I have following div,
<div class="info">
Review Status: <span style="color:green;"><strong>Active</strong></span>
| Order #:
...
0
votes
0
answers
22
views
curl in PHP behave diferrently in the same DOM pages
I run below code and it worked, but I see blank screen when I try with this URL : https://www.reddit.com/r/funny/comments/3aguyp/i_told_my_boyfriend_the_new_puppy_wasnt_allowed/
<?php include('...
3
votes
1
answer
99
views
simple dom parser double find() doesn't work?
Above is my DOM and I expect to get 4 hour ago but I got an error
Fatal error: Call to a member function find() on a non-object
My php look like this
$time_ago = $html->find('.entry .unvoted',...
0
votes
1
answer
84
views
Parsing an image using simple DOM
I want to parse an image from a HTML file using simple dom. I was using regex until now but everyone told me that this is a really bad idea, so I wanted to try dom.
<?php
include('simple_html_dom....
0
votes
1
answer
204
views
How to parse form elements from html response
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<...
3
votes
2
answers
7k
views
PHP Simple HTML DOM Parser: how to get contents of the parent div containing <h1> tags?
I'm scraping (using PHP simple HTML DOM) a number of different (news) sites with the aim of getting the main content/body of text on the page.
To do this the best way i could figure out was to find ...
0
votes
2
answers
148
views
reset key count in array
I have an array that is like this:
Array{
10 - 2011 Headlight Assembly Nissan Versa
11 - LH 07-11 INS QTLY O.E.M - FREE SAME DAY SHIPPING
12 - 000
13 - A0
14 - 40626A1
15 ...
0
votes
5
answers
279
views
Get text of the div that contains more than one characters [closed]
Imagine we want to get the div,span,p,etc of HTML page that the class OR ID name of that , contains some keywords like:
one & two & three
For example i have this HTML :
<div class="...
0
votes
2
answers
114
views
Finding a href links with simple dom
I am simplephpdom using to get a href links values with this code :
$html = file_get_html($url);
foreach($html->find('a') as $element) $array[] = $element->href . '<br>';
Now, the ...
1
vote
1
answer
99
views
extract div class simple dom
So I have a data structure that looks like this:
<h3>VIN: 1J8FA24177L168628</h3>
<div class="pendingPartDetail">
<div class="pendingPartNumber">1BE95XXXAD</div>
<...
0
votes
0
answers
357
views
Trying to copy a node in simpleXML , but it isn't copying attributes or children
I'm trying to split up an XML file via simpleDOM and PHP. There are several nodes, and I need to exactly copy each one and all of its children, then export them to a separate XML file. I have been ...
1
vote
1
answer
279
views
insert div between content using foreach with simple html dom parser
I'm using PHP simple dom parser, says my markup is like this
<table class="tb">..</table>
<table>..</table>
<table>..</table>
I tried
$banner = '<div class="...
0
votes
1
answer
184
views
concatenate div into scraped content
I'm using PHP simple dom parser, how should I insert extra entities within them? like $html contain
<table class="tb">..</table>
<table>..</table>
<table>..</table&...
1
vote
1
answer
1k
views
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:
<div id="field_11" class="fieldRow span12 lastFieldRow">
&...
0
votes
1
answer
897
views
Simple Html Dom Parser Issue
i am trying to understand how simple_html_dom works and fetch some data from specific category.
So i seted up a wp site to do some tests.
I took the code from official website and did some ...
1
vote
1
answer
62
views
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 ...
2
votes
3
answers
11k
views
How to find all element with PHP Simple HTML DOM Parser?
// Find all element has attribute id
$ret = $html->find('*[id]');
This is an example for finding all elements which have attribute id. Is there any way to find all elements. I try this way but it ...
0
votes
1
answer
145
views
PHP Simple Dom - Loop through one class at a time?
Is there any way to do this? currently I'm using this method to go through the td's for every table in a wikipedia entry that have a class of wikitable.
foreach ($html->find('table.wikitable td') ...
1
vote
4
answers
1k
views
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?
0
votes
1
answer
2k
views
Scraping & Returning JSON data php [closed]
I currently have a script, Can be found here:
http://ddelay.co.uk/bus/find_services2.php
With the following code:
<?php
include('simple_html_dom.php');
$service = $_GET["stop"];
$debug = $_GET["...
0
votes
1
answer
114
views
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 ...
0
votes
0
answers
977
views
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 ...
0
votes
1
answer
2k
views
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 ...
0
votes
2
answers
98
views
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:
<html><head></head>
<body>
<...
-1
votes
1
answer
82
views
PHP simpleDOM nested find [closed]
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 ...
0
votes
1
answer
243
views
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 '...
0
votes
1
answer
63
views
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['...
1
vote
2
answers
232
views
Simple dom to find out image url
I have an index.html code like this
<div class="photoImg">
<img src="http://host.com/images/image-name.jpg" alt="image" />
</div>
and I use this code to findout the image url (http:...
0
votes
2
answers
1k
views
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
<ArrayOfProgramList xmlns="http://schemas.datacontract.org/2004/07/Taca.Resources" xmlns:i="...