hi..
I converted the html page to xml.
I want to parse the image with xml2map.
there are two problems
1:I get the error as mentioned
2:do I parse an image in meta tags. (xxxx.jpg)
1
2(log)
** Activity (main2) Create, isFirst = true **
log: HTML: <meta http-equiv="pragma" content="no-cache">
log: HTML: <meta http-equiv="expires" content="-1">
log: HTML: <meta http-equiv="cache-control" content="no-cache">
log: HTML: <meta name="" content="text ">
log: HTML: <meta name="" content="website">
log: HTML: <meta name="" content="//www.website.com">
log: HTML: <meta name="" content="Starlingtar">
log: HTML: <meta name="" content="//website1/images/xxxx.jpg">
log: HTML: <meta name="" content="image/png">
log: HTML: <meta name="" content="300">
log: HTML: <meta name="" content="300">
log: HTML: <meta name="" content="t_T">
log: Google Tag Manager
log: HTML: <noscript>
dArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
thank you...
I converted the html page to xml.
I want to parse the image with xml2map.
there are two problems
1:I get the error as mentioned
2:do I parse an image in meta tags. (xxxx.jpg)
1
main2_activity_create (java line: 412)
java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map$MyMap cannot be cast to java.util.List
at b4a.exammjhple.main2._activity_create(main2.java:412)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at b4a.exammjhple.main2.afterFirstLayout(main2.java:104)
at b4a.exammjhple.main2.access$000(main2.java:17)
at b4a.exammjhple.main2$WaitForLayout.run(main2.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAn
java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map$MyMap cannot be cast to java.util.List
at b4a.exammjhple.main2._activity_create(main2.java:412)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at b4a.exammjhple.main2.afterFirstLayout(main2.java:104)
at b4a.exammjhple.main2.access$000(main2.java:17)
at b4a.exammjhple.main2$WaitForLayout.run(main2.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAn
2(log)
** Activity (main2) Create, isFirst = true **
log: HTML: <meta http-equiv="pragma" content="no-cache">
log: HTML: <meta http-equiv="expires" content="-1">
log: HTML: <meta http-equiv="cache-control" content="no-cache">
log: HTML: <meta name="" content="text ">
log: HTML: <meta name="" content="website">
log: HTML: <meta name="" content="//www.website.com">
log: HTML: <meta name="" content="Starlingtar">
log: HTML: <meta name="" content="//website1/images/xxxx.jpg">
log: HTML: <meta name="" content="image/png">
log: HTML: <meta name="" content="300">
log: HTML: <meta name="" content="300">
log: HTML: <meta name="" content="t_T">
log: Google Tag Manager
log: HTML: <noscript>
dArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
{
"article": {
"lang": "",
"para": [
{
"note": [
{"remark": "HTML: <meta http-equiv=\"pragma\" content=\"no-cache\">"},
{"remark": "HTML: <meta http-equiv=\"expires\" content=\"-1\">"},
{"remark": "HTML: <meta http-equiv=\"cache-control\" content=\"no-cache\">"},
{"remark": "HTML: <meta name=\"\" content=\"text \">"},
{"remark": "HTML: <meta name=\"\" content=\"website\">"},
{"remark": "HTML: <meta name=\"\" content=\"//www.website.com\">"},
{"remark": "HTML: <meta name=\"\" content=\"Starling\">"},
{"remark": "HTML: <meta name=\"\" content=\"//website1/images/xxxx.jpg\">"},
{"remark": "HTML: <meta name=\"\" content=\"image/png\">"},
{"remark": "HTML: <meta name=\"\" content=\"300\">"},
{"remark": "HTML: <meta name=\"\" content=\"300\">"},
{"remark": "HTML: <meta name=\"\" content=\"t_T\">"},
{"remark": "Google Tag Manager"},
{"remark": "HTML: <noscript>"},
{"remark": "HTML: <\/noscript>"},
{"remark": "End Google Tag Manager"}
],
"anchor": {"id": "body"},
"content": [
.........................
..................
...........
.....
...
.
.
"article": {
"lang": "",
"para": [
{
"note": [
{"remark": "HTML: <meta http-equiv=\"pragma\" content=\"no-cache\">"},
{"remark": "HTML: <meta http-equiv=\"expires\" content=\"-1\">"},
{"remark": "HTML: <meta http-equiv=\"cache-control\" content=\"no-cache\">"},
{"remark": "HTML: <meta name=\"\" content=\"text \">"},
{"remark": "HTML: <meta name=\"\" content=\"website\">"},
{"remark": "HTML: <meta name=\"\" content=\"//www.website.com\">"},
{"remark": "HTML: <meta name=\"\" content=\"Starling\">"},
{"remark": "HTML: <meta name=\"\" content=\"//website1/images/xxxx.jpg\">"},
{"remark": "HTML: <meta name=\"\" content=\"image/png\">"},
{"remark": "HTML: <meta name=\"\" content=\"300\">"},
{"remark": "HTML: <meta name=\"\" content=\"300\">"},
{"remark": "HTML: <meta name=\"\" content=\"t_T\">"},
{"remark": "Google Tag Manager"},
{"remark": "HTML: <noscript>"},
{"remark": "HTML: <\/noscript>"},
{"remark": "End Google Tag Manager"}
],
"anchor": {"id": "body"},
"content": [
.........................
..................
...........
.....
...
.
.
B4X:
Dim article As Map = ParsedData.Get("article")
Dim para As List = article.Get("para")
For Each colpara As Map In para
Dim note As List = colpara.Get("note")
For Each colnote As Map In note
Dim remark As String = colnote.Get("remark")
Log($"log: ${remark}"$)
Next
thank you...