Data scraping [ERROR] [UiPath.Studio.exe] [1] UiPath.Core.InvalidSelectorException

Hi, I have a workflow where I’m trying to scrape data from a web site using Data Scraping wizard. When selecting the data everything seems normal and wizards preview pane shows exactly what I’m trying to scrape but when running the workflow there is no output in the ExtractDatatable variable. debugging gives no no error, but I found there is an error in the Studio .log file

Does this tell anything to You what should I fix? Selector validation shows green

08:56:04.9083 => [ERROR] [UiPath.Studio.exe] [1] UiPath.Core.InvalidSelectorException: The selector is not valid —> System.Xml.XmlException: ‘<’, hexadecimal value 0x3C, is an invalid attribute character. Line 1, position 48.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String args)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at UiPath.Core.Selector.FromXmlString(String xml)
at UiPath.Core.Selector…ctor(String theSelector)
— End of inner exception stack trace —
at UiPath.Core.Selector…ctor(String theSelector)
at UiPath.Core.Activities.Design.SelectorEditorDialog.SelectorTextEditor_TextChanged(Object sender, EventArgs e)
08:56:12.4810 => [ERROR] [UiPath.Studio.exe] [1] UiPath.Core.InvalidSelectorException: The selector is not valid —> System.Xml.XmlException: ‘<’, hexadecimal value 0x3C, is an invalid attribute character. Line 1, position 48.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String args)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at UiPath.Core.Selector.FromXmlString(String xml)
at UiPath.Core.Selector…ctor(String theSelector)
— End of inner exception stack trace —
at UiPath.Core.Selector…ctor(String theSelector)
at UiPath.Core.Activities.Design.SelectorEditorDialog.UpdateEditingModel()

Hi @hemuli

Share the screenshot

Thanks
ashwin.S

Hi here are the screenshots. I deleted the studio log file and the error mentioned in the original post is not showing anymore :thinking: …but the issue remains, as no output from the scraping


Capture3

Well looking at the error stack I feel like the Table attribute is dynamic and changing as you reload or launch a new session of that webpage…

Why dont you try again by optimizing and generalizing the selector using UiExplorer.

or worst case, can you share the URL and your xamls so that we can triage this further if the above thing doesnt work?

Fine
if we are able to see the preview then the there would be an outcome of it for sure
–kindly check once the scope of the output variable of EXTRACT DATATABLE ACTIVITY like is it set with whole sequence in the variable panel
and try once

hope this would help you
kindly try this and let know for any queries or clarification
Cheers @hemuli

Hi, the variable should be in the scope. I attached the xaml if you might check and help with this issue. Main.xaml (15.0 KB)

Here is the url also:

Thanks!
@Raghavendraprasad @Palaniyappan

Well,

I whipped up a very basic code to test that, and I got the results without any issues… Do compare and find out what are you doing differently…

Ouput.csv is enclosed in the zip.DataScraper.zip (14.0 KB)

Hope this helps :slight_smile:

Hi, @Raghavendraprasad this is practically exactly the same how I did this…but I’m starting to think if it might be that there is something wrong with the data scrapper itself as I can’t scrape anything with IE. wizard selects only the whole IE browser window and giving error “invalid UI node”

if it is selecting the whole screen of the browser then check whether you are using Chrome or IE in your project and while indicating the element… :slight_smile:

I tried to install the Studio to another computer. Now I’m able to scrape data also with IE but the original issue remains. Extraction is giving no output but now append csv activity is giving error:

RemoteException wrapping System.ArgumentNullException: Value cannot be null.
Parameter name: encoding
at UiPath.CSV.Activities.AppendCsvFile.EndExecute

@Raghavendraprasad or @Palaniyappan maybe you can test my workflow is it working for you?

Thanksoikotietyopaikat.zip (14.0 KB)

Hi there,

I changed your code of max results to ‘0’ and it extracted everything that was there in all the pages.

Changes made -

  1. gave a next link selector.
  2. Gave some delay between pages.

thats all…

Hi, I don’t understand what can be wrong here. I did the same but no luck with the scrapping. It still gives the value can not be null exception. wizard preview shows all the data I try to extract but its doing nothing.

I tried to uninstall the UiPath studio and re-install it but with no help from this also. the uipath version I’m using is 2019.9.2 CE version.

@Raghavendraprasad I also tried to scrap from another random site and it’s working with no issues so it seems that the problem is not the uipath studio installation itself

@hemuli

Seems like the scraping works for me in same version of community edition. Somehow there seems to a minor disconnect…

Can you share your updated xamls again to see what differences are there?

You are using the same browser as I. So weird…

Hi, finally got it working! It was about browser security setting - Enable browser mode issue. Thanks a lot for your cooperation and help which made me seeking resolution from outside UiPath :slight_smile:

Can you edit your answer and give a bit more details so that it will be helpful for others too :slight_smile:thanks

I got help was able to scrap data after changing browser setting.

  • Goto tool in IE
  • Internet options
    -Security tab
  • uncheck “Enable Protected Mode” option and restart the browser.

This worked for me :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.