Apologies if i missed out something obvious or scraping wikis are not allowed. I am trying to get the names or filepath which contains the names of something on this page: Akuoumaru | Genshin Impact Wiki | Fandom , and then go to every single similar page like so : Genshin Impact Wiki | Fandom and get the same element.
I am able to do Steps 1-4 successfully, but it fails once i put everything in a ForEachRow of an excel data sheet.
A. Open excel that has 2 columns, Name and URL and load them into variables for use.
-Start Loop
- Open Browser (URL retrieved from step A.)
- Data Scraping → Attach browser → Extract Structured data from a particular DIV
- Assign the data from the ExtractDataTable into variables and add them as a new row to MasterDataTable.
- Close Tab
-End Loop
B. Convert MasterDataTable to excel.
The problem i am facing is in 2. Data Scraping and Attach browser.
Either of the following Failures happens:
- The selector wildcard is accepted and all the opened browser tabs navigate to the correct URL, but all the results scraped are that of the first page instead of being dependent on the browser tab that is opened
- The selector fails and no data is scraped, causing step 3 to fail as no data can be assigned. (There is no row at Position 0)
Selector Problem
The Selector Editor shows: "<html app='chrome.exe' title='Akuoumaru | Genshin Impact Wiki | Fandom' />"
I have tried variants of the following selectors, all leading to either failure scenario 1 or 2.
a. Changing the title name into a wildcard like so :
"<html app='chrome.exe' title='* | Genshin Impact Wiki | Fandom' />"
→ Failure 1 or 2, depends on whether idx is also set.
b. Changing the title name into a variable from my first excel:
"<html app='chrome.exe' title='{{currName}} | Genshin Impact Wiki | Fandom' />"
(I also logged currName to ensure the value is inside) → Failure 2 usually
c. Changing the selector to use URL as suggested by UI Explorer, which i provided as a variable from my first excel:
"<html app='chrome.exe' url='{{currUrl}}' />"
Edit: For reference, when i use the selector wizard with two different URLs, these are the values generated. They were how i came up with the various wildcard/variable solutions above.
<html app='chrome.exe' title='Blackcliff Slasher | Genshin Impact Wiki | Fandom' />
<html app='chrome.exe' title='Akuoumaru | Genshin Impact Wiki | Fandom' />
Any help is appreciated, i would guess the problem lies in the website selector.
Is UI Path studio not meant to be used this way, and every browser attach has to be done through the wizard?
Edit: I have tried the suggested changes to no avail, here is the new file and relevant excel file with current incorrect results and expected correct results.
third.xaml (20.5 KB)
excel_files.zip (19.9 KB)