You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Youzha <yu...@gmail.com> on 2020/02/08 01:03:23 UTC

parsing html table

Hi is there any way to parsing html table and insert it into mysql?
i want to put <td> value to my sql table.
please suggest

Re: parsing html table

Posted by Dan Stromberg <ds...@grokstream.com>.
I've heard numpy has a way of doing it, or you could use my from-table
script:
http://stromberg.dnsalias.org/~strombrg/from-table/

It'll give you CSV output.  From there you can convert to almost anything.

HTH.

On Fri, Feb 7, 2020 at 5:03 PM Youzha <yu...@gmail.com> wrote:

> Hi is there any way to parsing html table and insert it into mysql?
> i want to put <td> value to my sql table.
> please suggest
>

Re: parsing html table

Posted by Emanuel Oliveira <em...@gmail.com>.
Hi,

A simple processor
https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache.nifi.processors.standard.ReplaceText/
you can find(regex) and then replace(regex), meaning you have all the power
of regex at your disposal to modify ff contents.

For example, you could simply:
search(regex)= <td>(.*)</td>
replace(regex)= \1,

Im writing this while taking breakfast, so you may want to test, but
basically as you may know each pair of parenthesis in a regex its a regex
group where one can refer to that specific contents by \1 for 1st set, \2
for second set etc (left to right).

So limit of replace(regex) is your imagination, you can mimic csv, or
whatever format you want. The comma on replace (regex) simple adds a comma
so your html file becomes magically a list of values :)

Hope this helps,

Emanuel O.

On Sat 8 Feb 2020, 01:03 Youzha, <yu...@gmail.com> wrote:

> Hi is there any way to parsing html table and insert it into mysql?
> i want to put <td> value to my sql table.
> please suggest
>