Can I use Uipath to copy the content of some web pages, then save as word doc file? How to do it?
thank you very much!
Hi @shiyatoo
If the data is in a table you can use Data scraping. If it is simply in html tags you can save the webpage as html, read it in as string then remove the tags via regex such as <[^>]*>
, then use word activities to save to word file.
Kind Regards
I use “ctrl +S” to save the webpage, but there is nothing to return. it seems not work?
thank you very much!
save website.xaml (6.5 KB)
Hey @shiyatoo
You are willing to save the website content by using Ctrl+S
?
Or
You want to save the contents of the website to a file ?
Thanks
#nK
save the website body content to .doc file
Hey @shiyatoo
You can perform the below,
-
Open the website using
Open Browser
activity -
Use
Get Text
activity with selector like this
<html app='chrome.exe' url='*yourDynamicURL*' />
<webctrl tag='BODY' />
-
You need to save the output of the
Get Text
to a string variable -
Use
Write Text File
activity to create a ‘.txt’ file passing the above string variable which has the result ofGet Text
-
Hurray, your text file is ready with website content
If you want to save it to a doc file you need to just use word activities and write the same
Hope this helps you
Thanks
#nK
In the place of yourDynamicURL you need to replace it with either a dynamic URL variable you are using or the actual URL.
Thanks
#nK
In the field that says yourDynamicURL, type google.com/testtable for example.
some body content is not visible?
And the same selector is error?
Please enclose selector in double quotes.
Thanks
#nK
21.10.5+Branch.support-v21.10.Sha.369f46199a0fa6287d86ab2534b6896019db01bc
Source: Get Visible Text
Message: 捕获错误。
Exception Type: System.Runtime.InteropServices.COMException
RemoteException wrapping System.Runtime.InteropServices.COMException: 捕获错误。
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
unfortunately,I still don’t find the solution
thanks very much!