Is it Possible to have String Input as a WebPage Content?

Dears,

Is it Possible to have String Input as an WebPage Content? means we only enter URL for this page and it will get the content without scraping , just in the backgroud? Thanks in advance

1 Like

Hey @hsendel

When you say background you no need to open the browser?

Thanks
#nK

Exact!!! @Nithinkrishna, only get an URL from received email and the BOT will extract the content of this page directly and use it as input for processing data…It should be fine using web browser/scrapping, but the aim is to reduce execution time

1 Like

Hey @hsendel

So the URL will provide you text output right ?

If yes then you can use HTTP activity from UiPath.WebApi.Activities in which you will pass the URL which gives you back the string response which can be utilised further.

Hope this helps.

Thanks
#nK

1 Like

Great!!! I have installed the package, but I see only HTTP request activity inside ?
How to extract the content, how to define Output as string ?

1 Like

Yes that’s the one !

1 Like

I use the “result” as string output but when checking the returned content it’s showing page code not page content :disappointed_relieved:

1 Like

Hi @hsendel

:sweat_smile: This is why I was asking if that website has the text. But still not a problem.

Could you please open the link in the browser please and highlight what you want to scrape from it.

Thanks
#nK

1 Like

It doesn’t matter, i can scrap everything than I can filter what I want latter on. The aim is to check some keywords if exists in that content or no :slight_smile:

1 Like

Hey @hsendel

Perfect then, Could you please show the response you got from that HTTP activity.

I think it would have returned you the content with HTML code.

May be first thing to check if that is returning your content required (even though it will be returning in html format) & you can try directly to check keywords in that if that works.

Else we will manipulate it.

Thanks
#nK

1 Like

I need HTML format , not source code format, otherwise it will make my code more difficult when filtering

1 Like

Hey @hsendel

Could you please show the screenshot of the string returned or copy paste it here ?

Thanks
#nK

1 Like

Please find in attached file an output for this page ( this Topic) : Is it Possible to have String Input as a WebPage Content? - #12 by Nithinkrishna
Result.txt (59.3 KB)

1 Like

In case no way to get html format, it should be fine, this can help too :slight_smile:

1 Like

Hey @hsendel

I see the content in the file you shared but yes, it will be having HTML code along with it.

But still if you want to still only get the inner text, we need to do HTML manipulation with additional code logic.

Before adding the above efforts and code, I suggest if your keyword search works fine for this HTML code + Text output then it should be fine & no need of additional logic right !

Thanks
#nK

YES, I got keywords, but it will be good if i can make clean up of this file from all speciall characters : ‘!"#$%&’()*+,-./:;<=>?@[\]^_`{|}~’ except hyphen “-” because there are composite words like : follow-up

1 Like

Hey @hsendel

Just try the below,

Regex as below inside double quotes

[!""#\$%&’()*+,-\.\/:;<=>\?@\[\\\]\^_`{\|}~]

Thanks
#nK

1 Like

Please recall me of package needed for RegEx

1 Like

Hey @hsendel

UiPath.System.Activities will be the package which has the Replace activity, in which you can directly use regex as a string.

Thanks
#nK

1 Like

It should be fine now. Thanks a lot @Nithinkrishna :+1:

1 Like