Comments (3)
The element is there, just wonder why it comes null
from didom.
$document = $this->document; if (count($elements = $document->find('article.grid-col--fixed-tiles')) != 0) { foreach ($elements as $k => $e) { $ret = []; $ret['href'] = $e->find('a')[0]->attr('href');
Code looks a bit like that. If i use ->href it works but not if I use the attr or getAtttribute
from didom.
ini_set('display_errors', true);
ini_set('error_reporing', E_ALL);
// your code here
It means that tag a
not found in element.
Note: you can use first
method instead of find(...)[0]
:
$e->first('a');
from didom.
Related Issues (20)
- find не работает в cml файлах с кириллическими тегами
- Не работает $element->closest('body > *'); HOT 1
- element+element Selector Error
- wait to upload HOT 2
- DIDOM not working in Livewire components HOT 1
- trim() expects parameter 1 to be string, boolean given (0) HOT 3
- How to get Node xPath ? HOT 1
- PHP 8.2 deprecated mb_convert_encoding. HOT 2
- Search and preserve order HOT 2
- get all nodes HOT 1
- Fatal error: Uncaught RuntimeException: Could not load file
- loadHtml does not work with latest version HOT 2
- search on latin characters throws error
- Find all class, ID, Attribute, and tag in Document HOT 1
- Как отключить авто-обертку html body, и перенос тега style в head?
- How to unwrap a parent node and elevate the children?
- How to disable autofixing?
- find() all tags
- base64 to image failed
- `text()` Specification collection content is incorrect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from didom.