Sending data from localhost to specific telegram bot user

Hi everyone, I’m new n8n and I hope to get some help here.
I want to send data from a local database which has no API. The local url which I want to get data from has a table with customers and debts columns. For now, I want to scrape the URL for each customer name and send the list to a specific telegeam bot user id. Ideally, I want the user to search for a customer name (press a button with the cutomers name) and retrieve the amount of debt or any relevate data from that URL.
Is this possibe and how should I start?
any help is appreciated :slight_smile:

Edit: cleaning up

Hi @bawar

Welcome to the community!

Is this URL with the data already working? If so, is there already a way to filter? for example with URL parameter.
Also, is this already somewhat secure? As publishing this kind of information on a (local) network would probably not be the best for privacy reasons.

What I would do is create an API with n8n with the use of webhooks. Put some authentication in there to make it a bit more secure. (of course also limit it to be only internally if possible)
Here is a tutorial on how to do it, it is pretty old but it should still help you with the idea. If you are going this route, setup a basic first flow with the help of the tutorial and start asking questions here for the community to help you along further if needed.

1 Like

Yes the URL is working I use it in Power Query in Excel all the time. I tried HTTP Request and I have the data. But I’m stuck at HTML Extract step when I copy the selector of the table I get this

#table > div.overflow-x-auto.lg\ > table

which returns null in the HTML Extract node.

That is a great idea but for now I need to make it work first and using the telegram user ID will suffice. I will make the bot igonre everyone else except some specified user IDs.

This is what I came up with so far. I have two nodes one with headers an the other has the table rows
table headers

table body

Page not found

Hi @bawar

Sorry missed your message.
You should be able to just add a value to the HTML extract node. So no need for 2 separate HTML extract nodes.
We would need an example of the HTML to help you get specific data out of it. You can of course replace the actual data with dummy data to make it safe to share.


Sorry for that, I suspect this is related to our recent website migration. I’ll check this with the team.

1 Like

The redirect behind the link should now work as expected. Once again sorry and thanks for your patience!

@BramKn No problem. I made some dummy data as you said. This is the HTML I get in my HTTP Request.
and this is my attempt:

Last step give me a list like this:

[ "D001", "customer 1", "A1", "1", "$ 1,500.00", "D002", "customer 2", "B2", "2", "$ 1,609.00", "D003", "customer 3", "B1", "1", "$ 4,517.00" ]

I want to turn that into a table so that I could filter it by customer name (which I will be gettting from telegram). Basically searching the table for that customer and returning their data.

Where can I learn about manipulating the HTML in n8n?

@MutedJam Thanks a lot it is working now.

edit: typos and addtions

1 Like