# html parsing as xml fails

**URL:** <https://forum.knime.com/t/html-parsing-as-xml-fails/26398>\
**Category:** KNIME Extensions\
**Created:** [August 29, 2020, 9:51am UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398 "2020-08-29T09:51:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![laval](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@laval](https://forum.knime.com/u/laval)\
**Post date:** [August 29, 2020, 9:51am UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/1 "2020-08-29T09:51:46Z")

</div>

Hi all, the KNIME node Webpage retriever does fail with a null pointer exception if I want to download a specific html ([https://www.bmel.de/SiteGlobals/Forms/Suche/DE/Pressemitteilungssuche/Pressemitteilungssuche\_Formular.html](https://www.bmel.de/SiteGlobals/Forms/Suche/DE/Pressemitteilungssuche/Pressemitteilungssuche_Formular.html)) as XML Column. Here a third party node from MMI (Clean HTML Retriever) seems to have no issue with.

I furthermore have the problem that I often don’t receive the website with the first execution but with the second or third - my browser does not show that behavior.

With the GET node I was als not able to receive an XML with the accept option, but it shows also the many try to download issue

I added an example workflow (Get is not included).

Best,  
Lars

[html\_example.knwf](https://forum.knime.com/uploads/short-url/8YGJ4hd4Es5OMs4fs9Ao6GuOCNx.knwf) (119.2 KB)

---

<div class="post-metadata">

**Author:** ![JanDuo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@JanDuo](https://forum.knime.com/u/JanDuo)\
**Post date:** [August 29, 2020, 1:33pm UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/2 "2020-08-29T13:33:41Z")

</div>

Hi @laval,

A comment on

> [@laval](#):
>
> the problem that I often don’t receive the website with the first execution but with the second or third - my browser does not show that behavior

If you look at what is given with [https://www.bmel.de/robots.txt](https://www.bmel.de/robots.txt) you will see this website officially does not allow scraping the requested webpage, so it might already be a miracle you get it after a few attempts. Each domain will put their scraping rules in this robots.txt and if you scrape nicely you follow these rules.

If you still want to scrape this page, you need to mimic your workflows as a normal user (as if it uses “your browser”) as much as possible. So if the useragent you define for the worklow has to look like the one your browser is using. Your IP-address, the other part of what identifies you as requester of a webpage, will be more difficult to mimic unless you go to a provider with services for switching proxies ([Search on “proxy scraping”](https://startpage.com/do/search?q=proxy%20scraping)).

Scraping means you have to try to be nice to a domain (don’t flood them with your requests), otherwise you might get banned for some time (e.g. a week). When that happens even you on your browser will not be able to view the webpage (speaking from own experience when I knew nothing about this at all).

---

<div class="post-metadata">

**Author:** ![laval](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@laval](https://forum.knime.com/u/laval)\
**Post date:** [September 3, 2020, 2:27pm UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/3 "2020-09-03T14:27:24Z")

</div>

Hi @JanDuo,  
thanks a lot for mentioning that. I was not aware that I must not download this website. The information there is ment to inform the general public and I was just doing it to work around their lazyness to update their own rss feed they provide.  
I was checking the robot.txt and did not find a setting you described. I understood they just want to make sure it is not downloaded too often. But I am no expert in that^^.

However, the reason why I opened the ticket was to inform about a NULL pointer exception in the node - I would prefer a nicer error message 🙂

Best,  
Lars

---

<div class="post-metadata">

**Author:** ![JanDuo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@JanDuo](https://forum.knime.com/u/JanDuo)\
**Post date:** [September 3, 2020, 2:59pm UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/4 "2020-09-03T14:59:50Z")

</div>

Hi @laval

> [@laval](#):
>
> NULL pointer exception in the node

You are right, a null pointer exception is not informative. My Java-skills a pretty close to zero, so I’m afraid I cannot help you on that.

---

<div class="post-metadata">

**Author:** ![armingrudd](https://forum-cdn.knime.com/user_avatar/forum.knime.com/armingrudd/32/84633_2.png) [@armingrudd](https://forum.knime.com/u/armingrudd)\
**Post date:** [September 5, 2020, 3:34am UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/5 "2020-09-05T03:34:02Z")

</div>

Hi @laval,

The combination of [HTTP Retriever](https://nodepit.com/node/ws.palladian.nodes.retrieval.HttpRetrieverNodeFactory2) and [HTML Parser](https://nodepit.com/node/ws.palladian.nodes.retrieval.parser.HtmlParserNodeFactory) nodes seem to work all the time without any problems.

Also if you want to “scrape” the website, the [Selenium nodes](https://seleniumnodes.com/) would do that for you. It seems the page contains some event based content which cannot be collected by the retriever nodes as @JanDuo said. But Selenium nodes can do that for you since they are browser based.

[html\_example.knwf](https://forum.knime.com/uploads/short-url/t5Nuto6LAIDPxtC9BO8KxTyKYPS.knwf) (19.2 KB)

😊

---

<div class="post-metadata">

**Author:** ![laval](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@laval](https://forum.knime.com/u/laval)\
**Post date:** [September 5, 2020, 11:42am UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/6 "2020-09-05T11:42:12Z")

</div>

Hi @armingrudd,

thanks for mentioning the Selenium nodes. I did use them in the past but had issues as well. Nowadays, I want to focus on native KNIME nodes and hope they are well maintained on the long run. Furthermore, I don’t need to care about paying for liscenses.

Since, the one from MMI runs perfectly fine I guess KNIME cann achieve the same or a better error message at least 🙂

Best,  
Lars

---

<div class="post-metadata">

**Author:** ![armingrudd](https://forum-cdn.knime.com/user_avatar/forum.knime.com/armingrudd/32/84633_2.png) [@armingrudd](https://forum.knime.com/u/armingrudd)\
**Post date:** [September 5, 2020, 4:10pm UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/7 "2020-09-05T16:10:31Z")

</div>

The HTTP Retriever and the HTML Parser nodes are from [Palladian](https://nodepit.com/product/palladian) extension which is free. I mentioned them since you have to re-execute Clean HTML Retriever node to make it work in this particular case. The nodes from Palladian don’t have this issue.

😊

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 7, 2020, 9:37am UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/8 "2020-09-07T09:37:43Z")

</div>

Hello @laval,

tnx for reporting this issue together with workflow example. It has been added to existing ticket (Internal reference: AP-14916) which aims to solve same/similar behavior with [Webpage Retriever](https://kni.me/n/_8Xu5w4lsg_0hzf3).

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![laval](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@laval](https://forum.knime.com/u/laval)\
**Post date:** [September 7, 2020, 12:40pm UTC](https://forum.knime.com/t/html-parsing-as-xml-fails/26398/9 "2020-09-07T12:40:34Z")

</div>

@ipazin

Great! thank you!

Best wishes,  
Lars
