# Parsing HTML in Thunkable ✕ Cross Platform

**URL:** <https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177>\
**Category:** Questions about Thunkable X\
**Created:** [June 21, 2019, 7:23am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177 "2019-06-21T07:23:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![STX-121](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stx-121/32/11466_2.png) [@STX-121](https://community.thunkable.com/u/STX-121)\
**Post date:** [June 21, 2019, 7:23am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/1 "2019-06-21T07:23:14Z")

</div>

Hello!  
Help me please, is it possible to parse HTML pages in Thunkable ✕ Cross Platform?

I need to get some text from the HTML page that contains:  
**{«status»: 200, «data»: «486F6D6553616D6F676F6C312C3737372E302C3737372E302C302C»}**

I know that the text starts at **«status»: 200, «data»: «** and ends at **302C»}** , can I get this part of the text:  
**486F6D6553616D6F676F6C312C3737372E302C3737372E302C302C**?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 8:27am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/2 "2019-06-21T08:27:17Z")

</div>

Hello!

 ![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/a/cab9160221408b74029ce45f0aa22c995694ef6b.png)

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 8:34am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/3 "2019-06-21T08:34:58Z")

</div>

Hi, @STX-121!  
Will the HTML always be the same?  
If yes, I will suggest this :

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/49c2cca4ebdcbc733c818dd4c91ac48875d25238.png)

Hope it helps! 😉

---

<div class="post-metadata">

**Author:** ![STX-121](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stx-121/32/11466_2.png) [@STX-121](https://community.thunkable.com/u/STX-121)\
**Post date:** [June 21, 2019, 8:36am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/4 "2019-06-21T08:36:13Z")

</div>

Thank Actech!  
But you misunderstood me  
Only the anchors of the beginning and end of the text are known, the text itself is unknown (and it should be parsed)

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 8:37am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/5 "2019-06-21T08:37:01Z")

</div>

This is absolutely the solution 😄 👍👍

I just gave an easy way…

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 8:39am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/6 "2019-06-21T08:39:47Z")

</div>

Okay.  
From where will you get the HTML?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 8:41am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/7 "2019-06-21T08:41:36Z")

</div>

Yes, please show the line that you know. Otherwise, it is difficult for us to understand what you want to do.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 8:45am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/8 "2019-06-21T08:45:53Z")

</div>

Hi Kartik,

Instead of literal 26, I would use a block to determine the length of a string.

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 8:46am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/9 "2019-06-21T08:46:34Z")

</div>

Hmmm…  
You are also right!

Thanks!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 8:47am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/10 "2019-06-21T08:47:28Z")

</div>

Can you program in JavaScript?

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 8:48am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/11 "2019-06-21T08:48:11Z")

</div>

No… 😅  
I know only medium level C++ and a very little php…

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 8:49am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/12 "2019-06-21T08:49:48Z")

</div>

This is also good!

I say this to the fact that the knowledge of JavaScript helps a lot when programming on Thunkable X. Try it, you may like this language.

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 8:50am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/13 "2019-06-21T08:50:35Z")

</div>

Thanks for the Suggestion!  
how can JavaScript help me here?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 8:58am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/14 "2019-06-21T08:58:41Z")

</div>

While in Thunakble X there is no possibility of data exchange between WebViewer and App, but you can use JavaScript to work with WebViewer and create hybrid applications.

In my project, for example, JavaScript is used on the screens:

scrSystemInfo  
scrFileViewer  
scrChart  
scrHtml

[https://x.thunkable.com/projects/5cd84f23e3097f3353fdad45/project/properties/designer/](https://x.thunkable.com/projects/5cd84f23e3097f3353fdad45/project/properties/designer/)

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [June 21, 2019, 9:02am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/15 "2019-06-21T09:02:32Z")

</div>

Thank you so much! I will definitely try it!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 9:04am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/16 "2019-06-21T09:04:31Z")

</div>

As you know, Thunkable X is built on React Native core, and React Native is used by JavaScript.

It may seem too loud words, but JavaScript has just a huge scope.

---

<div class="post-metadata">

**Author:** ![STX-121](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stx-121/32/11466_2.png) [@STX-121](https://community.thunkable.com/u/STX-121)\
**Post date:** [June 21, 2019, 9:10am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/17 "2019-06-21T09:10:48Z")

</div>

> [@STX-121](#):
>
> {«status»: 200, «data»: «486F6D6553616D6F676F6C312C3737372E302C3737372E302C302C»}

Data is taken from a page similar to this: [https://samogon.pro/uart.htm](https://samogon.pro/uart.htm)  
The content and length of the text change every 5 seconds  
Only the beginning **{“status”: 200, “data”: "** and the end **302C"}** aways unchanged.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 21, 2019, 9:13am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/18 "2019-06-21T09:13:42Z")

</div>

Perfectly. Is my example not working for you?

 ![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/e/9e733c6ab438387fffb07e1539afdac9b5327f44.png)

> The content and length of the text change every 5 seconds

I did not see it

---

<div class="post-metadata">

**Author:** ![STX-121](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stx-121/32/11466_2.png) [@STX-121](https://community.thunkable.com/u/STX-121)\
**Post date:** [June 21, 2019, 9:45am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/19 "2019-06-21T09:45:39Z")

</div>

An example, unfortunately, returns “Undefined”, probably because the source text is not JSON

Page [https://samogon.pro/uart.htm](https://samogon.pro/uart.htm) is simply a sample.  
The original is formed on the ESP8266 and is used to control the Arduino from the smartphone.

---

<div class="post-metadata">

**Author:** ![STX-121](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stx-121/32/11466_2.png) [@STX-121](https://community.thunkable.com/u/STX-121)\
**Post date:** [June 21, 2019, 10:18am UTC](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177/20 "2019-06-21T10:18:14Z")

</div>

I solved the problem by simply replacing the text, this is not at all elegant and does not work on dynamic content, but in my case it works 🙂

It would be great to add the ability to search for a piece of text by starting/ending values.  
For parsing custom formats, that would be perfect!

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b93ef78e5cc257b98593e87edec77c8288900cf2.png)

[Next page](https://community.thunkable.com/t/parsing-html-in-thunkable-cross-platform/115177.md?page=2)
