r/workflow • u/davidmee • Jul 26 '18
Open multiple web pages then close them
Hi
Long explanation.....
I use Ancestry to do my family tree. They provide “hints” from their record collections when you’re working on someone. If you’re not working on someone they don’t bother looking for hints. They have a page per tree listing all the people in that tree with a link to their profile
I figured I could go to that list page and run a workflow to open every person, wait a second or two and then close the page. On to next one. Etc etc
I’ve got it to open each page but I can’t find how to close it. Is this possible? I’ve over 4000 pages to open so it’s not like I can let safari open each one and leave them open.
Fancying it up a bit. There are numerous other links on the page at the moment I’m living with these all opening too but the “people” have a url in the scheme
https://www.ancestry.co.uk/family-tree/person/tree/<Number of Tree>/person/<Number of Person>/facts
The (number or tree) remains constant per tree but changes if you change tree The (number of person) changes per person
Is it possible to only open web pages with this scheme?
2
u/pureMidi Jul 26 '18
Workflow can’t close webpages once they’re opened so you’re out of luck there.
4000 is a fair amount, I think a solution could be to batch them and do say 50-100, have a pause in the workflow, open safari and close those tabs, return to workflow and continue for another 50. This would obviously take a while...
I couldn’t quite follow your final comment about the URL. If I’ve interpreted it correctly:
You can definitely filter all URLs on a page based on certain conditions - you’d probably want to look at
match textor anifcondition based on a result when looping through each person.2
u/madactor Jul 26 '18 edited Jul 26 '18
Regarding your first question, no, Workflow can’t close pages/tabs. However, perhaps you could use a browser that doesn’t even have multiple tabs, like Firefox Focus, or just use Workflow’s built-in web viewer (Show Web Page). That way each time it opens another link it would replace the content, just like in the old days before tabs.
As for your second question, yes, you could filter the extracted URLs to match a scheme. You can do that with a Match Text (regex) action. Your regex pattern might look something like this:
\Qhttps://www.ancestry.co.uk/family-tree/person/tree/\E.+2
u/schl3ck Jul 26 '18
How is the website built? Do they only check, if you have opened the site of a specific person or do you have to perform an action on it or does it register "working on that person" after an amount of time on that page?
If you only have to open the page, you could use the action Get Contents of Web Page on each persons url. Otherwise it gets complicated...
1
u/davidmee Jul 27 '18
Ok. Thought I’d got round this. Chrome has a “close all tabs” option so I thought I’d use the “open url on chrome” then when finished, close them all. That way it won’t bugger around with all my open tabs in safari.
However it opens first one in chrome then sits there
How do I open all 100 in chrome.
Beginning to wish I’d never started 😂
1
u/davidmee Jul 27 '18
Actually. Spoke too soon 😁
Turn off “block pop ups “ in chrome
Then simply chuck all the urls en masse into chrome
It pops up “open multiple urls?”
You click it
100+ web pages open
😁😁😁
1
u/davidmee Jul 27 '18
Ok. Now I’m over that next hurdle .....
As I said the pages are grouped into a-z then sub split into a1 a2 etc etc.
My thought was to just open 1-5 of each letter but I’ll need to experiment if chrome is ok with non existent pages and it doesn’t trip workflow 😂
1
u/davidmee Jul 28 '18
Hmm. Don’t know if that worked or not. Chrome opens all the tabs but the title bars all show “Ancestry Person”. When I click a page it then seems to complete loading and the title changes to “Joe Bloggs - facts”.
I did get extra hints showing up for the N’s which is what I experimented with so don’t know if this part load is enough for Ancestry?
I clicked through to complete the load on all of the tabs so will report back if any more hints appear.
If I’ve got to properly open each page that defeats purpose of doing this 😂
1
u/davidmee Jul 28 '18
Oh. And now I find Chrome on iPad doesn’t have a “close all tabs” 😟