# Data request that depends on data input

**URL:** <https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568>\
**Category:** General\
**Tags:** http-request\
**Created:** [25 October 2022 12:54 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568 "2022-10-25T12:54:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![emerson](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@emerson](https://discourse.nodered.org/u/emerson)\
**Post date:** [25 October 2022 12:54 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568/1 "2022-10-25T12:54:42Z")

</div>

hello, I'm requesting data from a website to use in a project. However, I need to put the city and the type of tariff before getting the data, so that the http request and the html cannot pull the value

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [25 October 2022 13:28 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568/2 "2022-10-25T13:28:11Z")

</div>

From the http request node help text

> When configured within the node, the URL property can contain [mustache-style](http://mustache.github.io/mustache.5.html) tags. These allow the url to be constructed using values of the incoming message. For example, if the url is set to `example.com/{{{topic}}}` , it will have the value of `msg.topic` automatically inserted. Using {{{...}}} prevents mustache from escaping characters like / & etc

So if you had the msg properties  
`msg.one` set to string `"text"`  
`msg.two` set to number `10`

You could enter the url in the http request node as  
`http://example.com?string={{one}}&number={{two}}`  
The mustache template would convert it to  
`http://example.com?string=text&number=10`

Alternatively you could leave the url input blank and constuct thr url prior to the http request node, setting it to `msg.url` and the http request node would use that url.  
As the help text says

> url (string)  
> If not configured in the node, this optional property sets the url of the request.

---

<div class="post-metadata">

**Author:** ![emerson](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@emerson](https://discourse.nodered.org/u/emerson)\
**Post date:** [25 October 2022 14:23 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568/3 "2022-10-25T14:23:34Z")

</div>

[https://agenciavirtual.sabesp.com.br/web/guest/tarifas](https://agenciavirtual.sabesp.com.br/web/guest/tarifas)  
esse é o site que preciso retirar os dados mas preciso colocar os dados primeiro o que me impede usar o request

[translation: provided by moderator]  
this is the site where I need to get the data but I need to put the data first which prevents me from using the request

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [25 October 2022 16:01 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568/4 "2022-10-25T16:01:15Z")

</div>

You need to post better questions with more explanation.

The issue you are having then is the site posts a form to fetch the data, you will have to replicate the form request, or use Nbrowser or Puppeteer Nodes to load the page with Javascript and submit the form. Neither is a simple task.

---

<div class="post-metadata">

**Author:** ![emerson](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@emerson](https://discourse.nodered.org/u/emerson)\
**Post date:** [25 October 2022 16:31 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568/5 "2022-10-25T16:31:40Z")

</div>

![Captura de tela 2022-10-25 132912](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/576382d5188d4d9bb9cca9ae5cb64bfef12a1b78.jpeg)

 ![Captura de tela 2022-10-25 132929](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a92df00ff2679245d0d8a43292344b3d10aca86c.jpeg)  
preciso pegar alguns dados dessa pagina.

normalmente uso esses nó e funciona bem

 ![Captura de tela 2022-10-25 133235](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49fe010282fdd3baaed9ed136c4639c7ca316e5b.jpeg)

porem na pagina que mandei acima não consigo pegar os dados.  
creio que é devido ao formulário que pede antes de entrar nessa pagina. conforme na figura abaixo  
 ![Captura de tela 2022-10-25 132912](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/576382d5188d4d9bb9cca9ae5cb64bfef12a1b78.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 December 2022 16:32 UTC](https://discourse.nodered.org/t/data-request-that-depends-on-data-input/69568/6 "2022-12-24T16:32:29Z")

</div>

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