I have been working on learning UiPath by trying to scrap an ecommerce website.
With some generous help from @carmen, who helped with 2 of the selectors and other information, things worked for a few days (previous post: [SOLVED] How to set selectors for getting data from products details pages).
But while running the robot today I discovered that the website changed the page structure for some products at the section containing the detailed description of each product, so the previous selectors don’t work anymore.
So I try to scrape all the data from the section “Descriere” of each product from each product page taken from this list: https://www.emag.ro/laptopuri/
I think this element is stable and contains the data I’m looking for (the product description):
<div class="collapse-offset in" id="description-body" style="overflow-y: hidden;" uipath_custom_id="16">
And it is the first DIV inside of:
<div class="product-page-description-text" uipath_custom_id="5">
But UiPath doesn’t identify it automatically (what it gives me doesn’t work for all pages), and the manual solutions I tried don’t work either (I’m a beginner).
And all the tutorials I’ve seen so far only show easy cases with automatic selectors working immediately or only needing some very simple customization like replacing part of the page title or another element’s text with *.
What is a working selector for my pages?
Thank you for any help!
Could you please screenshots of what you are trying to get? Or, you can share the workflow.
It seems the following selector should work.
<html app='chrome.exe' title='*eMAG.ro' />
<webctrl id='description-body' tag='DIV' />
Thank you, @KannanSuresh!
The part of the workflow involved is in the screenshot number 1 below.
And the first part works: it opens up the browser & it displays the full description by clicking on the link.
I have tried right now the solution you suggest.
But it doesn’t work
It throws an error on the very first product page (https://www.emag.ro/laptop-gaming-hp-pavilion-15-bc408nq-cu-procesor-intelr-coretm-i7-8750h-pana-la-4-10-ghz-coffee-lake-15-6-full-hd-8gb-1tb-nvidia-geforce-gtx-1050-4gb-free-dos-shadow-black-4mr61ea/pd/D91WC1BBM/) with the text:
Source: Get Full Text 'DIV’
Message: Cannot find the UI element corresponding to this selector:
<html app='chrome.exe' title='*eMAG.ro' /><webctrl id='description-body' tag='DIV' />
Exception Type: UiPath.Core.SelectorNotFoundException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
UiPath.Core.SelectorNotFoundException: Cannot find the UI element corresponding to this selector: ----> System.Runtime.InteropServices.COMException: Cannot find the UI element corresponding to this selector:
at UiPath.UiNodeClass.FindFirst(UiFindScope scope, String nodeID)
at UiPath.Core.UiElement.FindFirst(FindScope scope, Selector selector, IVariableResolver resolver)
— End of inner ExceptionDetail stack trace —
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)
Then I tried other selectors (but they gave the same error):
<html app='chrome.exe' title='* - eMAG.ro' /><webctrl class='collapse-offset in' id='description-body' tag='DIV' />
<html app='chrome.exe' title='* - eMAG.ro' /><webctrl class='collapse-offset in' tag='DIV' />
<html app='chrome.exe' title='* - eMAG.ro' /><webctrl class='product-page-description-text' tag='DIV' />
(This section used to be scrapped correctly into a table using ExtractData activity and converting the resulting table to text - see screenshot 2 below. But I found more and more pages now that have DIVs with text plus a table with text, or only DIVs with text and no table… so that old selector isn’t useful anymore.)
SCREENSHOT 1 - Current workflow:
SCREENSHOT 2 - Old workflow, working only for tables: