I have the text & logos in the form of code.
Could you give the original flow a try with this view? The form should be much easier to work with than the editing applet.
I try and unfortunately there are two problems after to click on âsourceâ:
1- I canât select my paragraph of interest alone
2- With send hotkey âCtrl + aâ and then âbackâ, the bot select all the text and all characters of the page and then back to the previous page too
If it selects all text, thatâs already a good sign. Probably using the del key will do the trick.
As to the selecting the paragraph, it probably is now encapsulated with some tags. You will need to find pieces of your text and see how to adapt your replace/remove method.
I try too with âDelâ Send Hotkey, unsuccessfully.
I try in the âelement scopeâ and the Ctrl + a" and then âdelâ work. Good thing.
Now I shoud to found, how to select my paragraph of interest, I think that Get text not work in that case.
Good to hear we went a step further
I would say it should. Try first the Get Text on your form box and then output the content to the console with a simple Write Line activity (or write it to a text file).
Then itâs a matter of locating your string and finding and removing it.
Once again, a working example with a simple website on the entire process of changing the top line
SendHotkeys_v3.zip (32.4 KB)
Get text and Get ocr text doesnât work
That is really surprising, but another way would be to use Copy Selected Text activity after selecting the text with Send Hotkey Ctrl + A (which is confirmed to be working).
You also mentioned that the Get OCR text doesnât work. Does it mean that no options of the Screen Scraping wizard work here? Screen Scraping wizard is a fast way to get feedback of what is possible on the page and it creates 1 activity at the end: Get Full Text. It might be the way to go here to debug the issue a bit.
That doesnât work because I should to select manually the text for my paragraph. To select all the text itâs ok.
So Send hotkey âctrl + aâ select all the text, not one part as I would like now ^^
Indeed with Screen Scraping is better
I test all that and I let you know
The point here is to copy entire string to the variable, modify this variable and then replace the entire textbox with the edited variable.
It is okay to select the entire text
After you loaded that entire long and awkward string to a variable, modifying it is as easy as:
yourLoadedString.Replace("yourStringToBeReplaced","")
This will replace your paragraph with nothing, effectively removing it.
After that, you just have to paste the string in the box again.
It is possible to do it seemingly, such as:
- Send Hotkey Ctrl + A to select all
- Copy Selected Text to a variable called
inputString
- Send Hotkey del to delete the content of the box already
- Assign activity to modify your string:
modifiedString = yourLoadedString.Replace("yourStringToBeReplaced","")
- Set To Clipboard activity to set your newly modified string
- Send hotkey Ctrl + V to paste the
modifiedString
back to the textbox.
ok but I should to add an activity. Indeed, I need to extract âyourStringToBeReplacesâ to a variable because itâs a HTML code so I canât to put in directly in an Assign activity as you can see:
This is happening due to the double quotes. Every double quote needs to be âescapedâ with another double quote.
This will not work:
at your earliest convenience.</span></span></span></p>",""
But this will work for sure:
at your earliest convenience.</span></span></span></p>"",""""
Iâve just tested it and the alternative is to load your long string from a text file. After I loaded the string from a text file into a variable, I could use this syntax in the replace Assign activity literally:
modifiedString = yourLoadedString.Replace("yourStringToBeReplacedLoadedFromTxtFile","")
Indeed with double double quotes the assign is valid.
So I do:
1- Scrap all the text to a variable (VariableText)
2- I assign my variable text as here: VariableText = VariableText.Replace(âthe text code of the paragraphe of interestâ, " ")
3- I Set to clipboard my VariableText
4- Send Hotkey âCtrl + aâ
5- Send Hotkey âDelâ
6- Send Hotkey âCtrl + vâ
7- Click again on Source to check
And⌠Itâs work
Thanks a very much @loginerror for your help
Iâm glad it works!
Finding these workarounds is what RPA is really about
This just started to happen with the 19.11.1 UiPath.UIAutomation.Activities and the UiPath.System.Activities 19.10.1 updates. This happens with me as well.