php


DOMDocument::load a lot of warnings


my problem is that i have a small code, with a large error. can you help me solve this?
i need to make an assignment for school, where i need to get one image from this whole site www.asaphshop.nl
this is my (little) code:
<?php
$source = "http://www.asaphshop.nl";
$doc = new DOMDocument("");
$doc->load($source);
echo $doc->saveXML();
?>
these are all my errors:
Warning: DOMDocument::load(): error parsing attribute name in http://www.asaphshop.nl, line: 132 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): attributes construct error in http://www.asaphshop.nl, line: 132 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): Couldn't find end of Start Tag iLength line 132 in http://www.asaphshop.nl, line: 132 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): Opening and ending tag mismatch: input line 144 and script in http://www.asaphshop.nl, line: 152 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): Opening and ending tag mismatch: link line 232 and head in http://www.asaphshop.nl, line: 333 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): Entity 'nbsp' not defined in http://www.asaphshop.nl, line: 368 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): xmlParseEntityRef: no name in http://www.asaphshop.nl, line: 465 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): xmlParseEntityRef: no name in http://www.asaphshop.nl, line: 465 in C:\xampp\htdocs\stage\ripper3.php on line 4
Warning: DOMDocument::load(): Opening and ending tag mismatch: li line 652 and ul in http://www.asaphshop.nl, line: 661 in C:\xampp\htdocs\stage\ripper3.php on line 4
Web page on http://www.asaphshop.nl has invalid HTML, so DOMDocument couldn't parse it. Your code is correct.
Try to use another HTML parser.
By the way, there are warnings, not errors. You can get rid of them in php.ini settings.
This is because the HTML of http://www.asaphshop.nl is invalid. If you want to print those warnings, you can do it like this:
$source = "http://www.asaphshop.nl";
$doc = new DOMDocument("");
#$doc->load($source);
echo $doc->saveXML();
if you want to fix the HTML, you can look here: PHP parsing invalid html

Related Links

Extracting images from an array
First value as the key in PHP array
Convert Visual Basics Byte to PHP format
Vimeo PHP API How do I add my recently Uploaded Video to a Channel?
Why codeigniter not showing the variable sent from controller to view?
L5 Pagination keeping current url variables when changing pages
php readfile() and fopen() damaged/corrupt download
How we upload video file in google app engine with ZF2
Magento Aheadworks Automatic Product Callouts doesn't show on website
How To generate id based on joining query result
Pagination codeigniter not directing to class active link
PDO Memory Exhausted
Server side PHP session is not working in android
Iframe src will not load a .php form
Get substr from string
regex find input value

Categories

HOME
rust
flask
powerbi
message-queue
stacktrace.js
jint
visualforce
fedora
jpa-criteria
port
driver
angular4
trace32
async-await
tfsbuild
http-authentication
nullreferenceexception
bazaar
adminlte
pe
device
sybase-ase
opentext
environment
spreadsheetgear
macromedia
pyspark-sql
miniprofiler
spring-annotations
social-networking
jsonresult
john-the-ripper
knights-tour
appcode
nanogallery
cloudera-quickstart-vm
telephonymanager
mars-simulator
gitolite
android-n
sbjson
flowchart
oauth2-playground
icepdf
robust
virtual-memory
apache-toree
jenkins-slave
viewmodel
ilrepack
amazon-elastic-beanstalk
datediff
gtk#
network-protocols
prefetch
rational-performance-test
google-identity-toolkit
mathjs
gcloud-node
traversable
jeditable
ioexception
json-spirit
python-cffi
bootstrap-wysiwyg
relational-model
textscan
com0com
fuseesb
camus
mod-auth-openidc
lifetime
category-theory
rails-api
air-native-extension
proxy-server
indesign-server
sunstudio
aero
proc-open
lynx
stretch
image-formats
prefuse
monocross
dropshadow
yuidoc
microblogging
zend-server-ce
will-paginate
groovy-console
botnet
css-friendly
3des
mygeneration
jdownloader
google-translator-toolkit
gui-designer
community-server

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile