# Http request activity - Wait for page complete load

**URL:** <https://forum.uipath.com/t/http-request-activity-wait-for-page-complete-load/444263>\
**Category:** Studio\
**Tags:** http-request, activities-panel, question, studio, webapi, activities\
**Created:** [May 31, 2022, 8:46pm UTC](https://forum.uipath.com/t/http-request-activity-wait-for-page-complete-load/444263 "2022-05-31T20:46:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angel\_ramirez](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/angel_ramirez/32/266914_2.png) [@angel\_ramirez](https://forum.uipath.com/u/angel_ramirez)\
**Post date:** [May 31, 2022, 8:46pm UTC](https://forum.uipath.com/t/http-request-activity-wait-for-page-complete-load/444263/1 "2022-05-31T20:46:37Z")

</div>

Hi,

I am using http request as web scraping to get the html from a web page in order to avoid web interaction, I have noticed that http request works but not as I would like to, due to the http request out put returns the html before java script finishes loading data.

How can I give a delay to http request in order to wait for the javascript finishes loading data?

This is the example of the web page:  
[https://www.msc.com/en/track-a-shipment?MEDUZZ826807](https://www.msc.com/en/track-a-shipment?MEDUZZ826807)

I want to get the data without interact with the web page.

Thank you!

---

<div class="post-metadata">

**Author:** ![Edwin\_Barahona](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edwin_barahona/32/310876_2.png) [@Edwin\_Barahona](https://forum.uipath.com/u/Edwin_Barahona)\
**Post date:** [May 31, 2022, 9:10pm UTC](https://forum.uipath.com/t/http-request-activity-wait-for-page-complete-load/444263/2 "2022-05-31T21:10:00Z")

</div>

You may want to create a web client and get the content asynchronously. The method below will return a stream which you can send to a string using a stream reader and the readToEnd method. You can implement it using the Invoke Code activity

> **[HttpClient.GetStreamAsync Method (System.Net.Http)](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.getstreamasync?view=net-6.0)**
>
> Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

> **[StreamReader.ReadToEnd Method (System.IO)](https://learn.microsoft.com/en-us/dotnet/api/system.io.streamreader.readtoend?view=net-6.0)**
>
> Reads all characters from the current position to the end of the stream.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [June 8, 2022, 3:41pm UTC](https://forum.uipath.com/t/http-request-activity-wait-for-page-complete-load/444263/3 "2022-06-08T15:41:25Z")

</div>

Closed on June 8, 2022, 3:41pm UTC

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