Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value of text element is null #183

Closed
Nimo11 opened this issue Jun 4, 2024 · 2 comments
Closed

value of text element is null #183

Nimo11 opened this issue Jun 4, 2024 · 2 comments
Labels

Comments

@Nimo11
Copy link

Nimo11 commented Jun 4, 2024

You recommend using the value property of an element, but this property remains empty.

In your example, you use item.findElements('title').firstOrNull?.innerText.

Is this how it's supposed to work? I'm using the https://github.com/OmkarDabade/webfeed_plus plug-in, which no longer works so i supose it work at start.

[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [version 10.0.19045.4412], locale fr-FR)
• Flutter version 3.22.1 on channel stable at c:\src\flutter
• Upstream repository https://github.com/flutter/flutter
• Framework revision a14f74ff3a (13 days ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at D:\Users\info\Android\SDK
• Platform android-34, build-tools 34.0.0
• ANDROID_SDK_ROOT = D:\Users\info\Android\SDK
• Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33205.214
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2023.2)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] VS Code (version 1.89.1)
• VS Code at C:\Users\info\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.90.0

[√] Connected device (4 available)
• SM G960U1 (mobile) • 36344b3547413098 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [version 10.0.19045.4412]
• Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.114
• Edge (web) • edge • web-javascript • Microsoft Edge 125.0.2535.79

[√] Network resources
• All expected network resources are available.

Thanks

@renggli
Copy link
Owner

renggli commented Jun 4, 2024

I realize that the comment on the XmlData.text override might be confusing referring to value only, but in the context of XmlData and its subclasses XmlText and XmlCDATA it makes sense.

In the general case, and I assume that is what matters for your example, the documentation from XmlNode applies:

  • value returns the value of the node itself, or null,
  • innerText returns the concatenated text of the node and its descendants, and
  • text is deprecated, but behaves like innerText and delegates to it.

So probably you want to use innerText instead? Though, not sure what the problem exactly is without a minimally reproducible example?

@Nimo11
Copy link
Author

Nimo11 commented Jun 5, 2024

Thank you for your prompt reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants