I have a table from which I have to scrap a single row using data scraping. How can I achieve this?
Scrap the data, retrieve it in a string. Then split the string to gain the content you actually need.
Use Data Scraping to read table and will give you output as DataTable and say ‘DT’.
To read first row from DataTable - DT(0)
@lakshman I need to extract the row where Year = 2018. How can I do that?
If it is possible, you can try like this way also
row = dtTest.AsEnumerable.FirstOrDefault()
Try below one:
DataTableName.select("Year = ‘2018’ ") - It will give you array of data rows as output.
@lakshman Its not working. I am getting the following error:
I am trying to get the row with year=2018 from that table above.
Follow these steps:
- First scrape Data from Website and will give you output as ‘DT’.
- Then apply filter - DT.select("Year = ‘2018’ ").copytodataTable and store output in variable of type DataTable and say ‘NewDT’
- Then use Output DataTable activity to convert dataTable to string and pass NewDT here. Then display output string using message box.
@lakshman I am still getting the above error!!
Could you please share your workflow with me and need to check once.
These should work.
- Scrape Data then save sa DataTable
- Use For each row activity to iterate each row
- Use if activity inside the body of For each Row
- Input these as the condition --> row(“Year”) = “2018”
- Inside then use assign activity to assign the values of the rows. (e.g. row(“mat”).ToString, row(“Inns”).ToString and so on)
Hope this helps
Please find the attached workflow. Here, Column name is ‘Year’ but you used ‘Column-0’. I changed now. Please run it and let me know. I am not able to open this site because my company blocked it.
PS3_Final_Project.zip (26.6 KB)
@lakshman Nope, it isn’t working. Same error.
After scraping data and write into excel file and send me once.
Player Stats.xlsx (9.4 KB)
I tried its working for me. Please find the attached file. Here, I am reading input data from excel and then filtered it and displayed. Run it and check once.
Main.xaml (34.9 KB)
Note: Just change the file path in Excel application scope and run.
no it isn’t working on mine.