How to fetch website login data into node red?

Hi guys,
I have been creating a website using php as back end and mysql as my database. Now I want to display which user is login to the system at node red. Is there any way to fetch the data from website to node red?

You could allow remote access to your database and query it directly.
Or
You could query a php script with a http request similar to this post MQTT data to a mySQL to display data on public website - #12 by astrojav Except using a select query and returning the data in the http response.

Actually I'm trying web scraping the php webpage.

[
    {
        "id": "3f63704b70cdd6cb",
        "type": "html",
        "z": "e126ae3a7d294319",
        "name": "",
        "property": "payload",
        "outproperty": "payload",
        "tag": "table.table>tbody>tr>td",
        "ret": "html",
        "as": "single",
        "x": 590,
        "y": 200,
        "wires": [
            [
                "9ec76d33b583479e"
            ]
        ]
    }
]

This my flow and I'm getting empty array not sure why.

Probably because the data in that table is populated by script that is probably fetched from another endpoint AFTER the HTML is loaded.

In your browser's developer tools, select the network tab & refresh the page. You should see all of the requests made. One of them will contain this data. Get that URL & use it in HTTP request node instead of trying to scrape the page.

Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.