# Help on uri module

**URL:** <https://forum.ansible.com/t/help-on-uri-module/33442>\
**Category:** Ansible Project\
**Created:** [July 20, 2020, 6:38pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442 "2020-07-20T18:38:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gajendra\_Gaikwad1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gajendra\_Gaikwad1](https://forum.ansible.com/u/Gajendra_Gaikwad1)\
**Post date:** [July 20, 2020, 6:38pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442/1 "2020-07-20T18:38:46Z")

</div>

Hello All,  
I would like to fetch some data using uri module, but little concern is that uri module should wait for 30 second to complete to load the page (page has same dynamic data which required 30 second to load (asp) )

How do i meet this requirement.

Thanks in Advance.

Regards  
GG.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 20, 2020, 7:43pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442/2 "2020-07-20T19:43:49Z")

</div>

[https://docs.ansible.com/ansible/latest/modules/uri\_module.html#parameter-timeout](https://docs.ansible.com/ansible/latest/modules/uri_module.html#parameter-timeout)

---

<div class="post-metadata">

**Author:** ![Gajendra\_Gaikwad1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gajendra\_Gaikwad1](https://forum.ansible.com/u/Gajendra_Gaikwad1)\
**Post date:** [July 20, 2020, 8:03pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442/3 "2020-07-20T20:03:40Z")

</div>

| 

request.

 |
| 

**timeout**   
integer

 | 

**Default:**

30

 | 

The socket level timeout in seconds

 |

“Socket Timeouts. … Socket timeouts can occur when attempting to connect to a remote server, or during communication, especially long-lived ones. They can be caused by any connectivity problem on the network, such as: A network partition preventing the two machines from communicating. The remote machine crashing.”

In my case connection is getting established.

I would like to wait uri connection till load the page and then return the static and dynamic values  
"

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [July 20, 2020, 8:17pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442/4 "2020-07-20T20:17:40Z")

</div>

Are you actually running into a problem? Also, the `timeout` parameter affects all blocking operations, including recv/read.

The optional _timeout_ parameter specifies a timeout in seconds for  
blocking operations like the connection attempt (if not specified, the  
global default timeout setting will be used). This only works for HTTP,  
HTTPS and FTP connections.

I created a toy webapp, that would sleep for a random period of time between 60 and 120s. At the default 30s it would fail, I extended the timeout to 120s, and it works as expected every time.

---

<div class="post-metadata">

**Author:** ![Gajendra\_Gaikwad1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gajendra\_Gaikwad1](https://forum.ansible.com/u/Gajendra_Gaikwad1)\
**Post date:** [July 20, 2020, 8:23pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442/5 "2020-07-20T20:23:15Z")

</div>

Thank you Matt and Visser  
I will check and let you know.

---

<div class="post-metadata">

**Author:** ![Gajendra\_Gaikwad1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gajendra\_Gaikwad1](https://forum.ansible.com/u/Gajendra_Gaikwad1)\
**Post date:** [July 21, 2020, 7:57am UTC](https://forum.ansible.com/t/help-on-uri-module/33442/6 "2020-07-21T07:57:04Z")

</div>

No luck, output is coming immediately even I set to timeout: 120

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [July 21, 2020, 8:31am UTC](https://forum.ansible.com/t/help-on-uri-module/33442/7 "2020-07-21T08:31:15Z")

</div>

> Hello All,  
> I would like to fetch some data using uri module, but little concern is that uri module should wait for 30 second to  
> complete to load the page (page has same dynamic data which required 30 second to load (asp) )

How does the page load the dynamic data? The uri module retrieves only the page but the dynamic data is probably loaded  
by Javascript.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Gajendra\_Gaikwad1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gajendra\_Gaikwad1](https://forum.ansible.com/u/Gajendra_Gaikwad1)\
**Post date:** [July 21, 2020, 9:23am UTC](https://forum.ansible.com/t/help-on-uri-module/33442/8 "2020-07-21T09:23:42Z")

</div>

Its asp page which check if application running or down

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [July 21, 2020, 9:41am UTC](https://forum.ansible.com/t/help-on-uri-module/33442/9 "2020-07-21T09:41:24Z")

</div>

> Its asp page which check if application running or down

And there is no other way to retrieve this information?

uri module wouldn't help as it doesn't trigger the retrieval of dynamic data, you need  
a (headless) browser for that.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Gajendra\_Gaikwad1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gajendra\_Gaikwad1](https://forum.ansible.com/u/Gajendra_Gaikwad1)\
**Post date:** [July 21, 2020, 12:50pm UTC](https://forum.ansible.com/t/help-on-uri-module/33442/10 "2020-07-21T12:50:38Z")

</div>

Thanks Racke.

now I am using python with selenium module to achieve this task

Thanks to everyone
