cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Web Value

MadhuGarg
Level 4
Hi All,

How to read values from a web page using code stage (Vb or c#) ?
Thanks.

------------------------------
Madhu Garg
------------------------------
5 REPLIES 5

Carl__Carter
Staff
Staff
Hi Madhu,

Can I ask the reason for wanting to read values from a web page using VB.NET / C#, instead of using the Blue Prism Read stage? Reading a web element spied using the Browser spy via a Read stage, should deliver excellent performance if the appropriate match criteria has been defined.

Unless you have built a custom .NET which contains a browser control, what you are asking is not that straight forward. You could look at creating a Python script to read data from the web page, and then execute this from a code stage. You could also look at the Selenium WebDrive as an option.

Another "out of the box" option could be to use the 'HTTP Request' Action in the 'Utility - HTTP' Business Object to perform a GET method using the target URL. This will return the page HTML to a Data Item in Blue Prism. You could then parse the values you are looking to extract.

------------------------------
Carl Carter
Senior Developer
Blue Prism
Europe/London
------------------------------

Hello Carter,

To answer your question, why I need to use code stage to read is because currently I am working with a web application where I need to read the value (Which ever value is on the screen. Actually it's a dropdown and while raising request the user must have selected a value from the dropdown.) 
While I tried to read the value using Read stage, the Output is coming as all of the value under the dropdown.

So I am trying use if c# or VB.Net can help !

Please suggest how to proceed. Thank you.

------------------------------
Madhu Garg
------------------------------

Hi Madhu,

You can use the 'Get Selected Items' action in the read stage to get the value which has been selected.

------------------------------
Carl Carter
Senior Developer
Blue Prism
Europe/London
------------------------------

Hello Carter,

Actually I have used the same, but the problem is it's getting stored in a collection with all the values present in the dropdown.
But we just need the value present on the web page.

------------------------------
Madhu Garg
------------------------------

If the element is spied as a List (Web), and the Web Element Type spies as type 'SELECT', then only 1 item can be selected from the list, therefore the 'Get Selected Items' will only return one row to the Collection. This value is the selected item of the SELECT element.

Please share a screenshot of Application Modeller displaying the attributes for the problem element.

------------------------------
Carl Carter
Senior Developer
Blue Prism
Europe/London
------------------------------