I Just learned of Ui.Vision its a plugin for Chrome/Firefox but it will not run on a phone, it needs a computer, but it will do exactly what you need.
You'd create a macro per action and you can then call the macro through a batch/sh file,
this should be easy with join/autoremote/ssh/mqtt etc
Try a different selector. ChroPath extension is pretty good at finding alternatives.
Also, I would recommend using UI.Vision for web automation. It has an API that you call from PowerShell and use them interchangeably.
There are a few ways to go about this, and it comes down to how tech savvy you are.
EXTREMELY TECH SAVVY: dig in to your corporate IT infrastructure. make nice with the site admins and figure out where they're pulling that information and see if you can make the same database call without having to go to the website. For the social media stuff you'll have to resort to scraping (see below).
Pretty Tech Savvy: Use python to download the HTML for the pages and parse it as below
Tech Savvy: Using something like Python or javascript you can usually scrape this information. fields like 'positions available' are generaly in what's called a div in the HTML. These div sections are generally named, so you can say something like "code, find me the div named 'positions_available' and get me the value associated with it". Obviously not executable code, but you get the gist. The social media portion can likely be done in a similar way. To identify the name of the div you're looking for, you can hit F12 in your browser to pull up a developer's console to look into the underlying HTML.
not at all Tech savvy: look into UI Vision, a free RPA robot that specializes in browser screen scraping. You walk it though the specific steps - open a page, select this text, close page, open next page, select this other text, etc etc. You save the steps as a macro, and then you can run that macro whenever you like. After that, you just have to find a way to schedule that macro to run without your input.
If you're entering the data through a web browser, I recommend using a browser automation tool like Kantu. It reads spreadsheets (saved as a CSV file) and types in the data for you from the spreadsheet and scrolls/clicks through the form and submits. Then you can set it to look for a confirmation message to click on before proceeding with the next iteration. Almost all of this you can do just by recording yourself doing it, then changing it to read the columns in the spreadsheet and telling it to go row by row.
Honestly, I wouldn’t say that using the Chrome extension (aka Selenium IDE) is automation - it’s a macro playback tool at best and is inherently very limited in what it can do, and it’s inherently inelegant.
Nevertheless, why would you need to click a bookmark if you can just designate the URL you’d like Selenium IDE to navigate to every time? Are you testing your site or the Chrome browser(which is silly)?
Either way, here’s a link to show you how to “Open” a URL - it was the first link that popped up in the Google search.
You should close the browser inside on UI.Vision directly so it can close correctly, write to the log, etc. with the argument: closeBrowser=1
Second, it is not advisable to close a browser with Stop-Process due to the same issues with logs, cache, etc. There are plenty of people times when the browser won't open again and crashes after a stopped process.
If you want to close something gracefully via PS you can use:
Get-Process -Name myappname | ForEach-Object { $_.CloseMainWindow() }
Dans le style "macro", j'ai déjà automatisé quelques tâches avec UI.Vision, basé sur Sélénium si je dis pas de bêtise
Ca enregistre les actions c'est en partie no code, tu peux les éditer ensuite. J'ai déjà fait des macros du style "vas sur ce site, clic sur tel bouton, rentre tel login et password, press Entrer, clic sur ce bouton radio et celui ci et enfin sur exporter".
Y a des fonctions screenshot et peut-être extraction de données, à creuser.
I use the ISE to record and build the basic macro. It will automatically find multiple selectors. I try to use text, links, buttons, or labels first because they are less prone to break. I'll pick XPath last because it's fragile and it will change even if something else before it changes on the page. With one click I find a new selector.
For example clicking a button named category this won't be changing: //*[text()='Category']
your script will break everytime a page is updated doing it your way: $Firefoxdriver.FindElementByXPath("xpath=//td[5]/div/div/div/div")
For more complicated sites I can use JavaScript right on the page to I need to say calculate a date for a button to push or even use visual to ID something or send real keyboard keystrokes for those weird sites that fail with selenium.
Here is info on comparisons with Selenium IDE:
https://ui.vision/rpa/docs/selenium-ide#side
https://forum.ui.vision/t/can-ui-vision-runs-in-cli-mode-like-selenium-ide/7625
This seems like a much nicer way of utilizing Selenium. I'm pretty sure I installed the IDE at first and gave up, but this looks very handy in a similar fashion.
My question is, how do you get the code power Powershell from this? Can you provide a very simple inline script in your reply where you go to Google and search something simple, just so I can see the resulting code (as well as letting me know how you ended up getting it out of UI.Vision)?
Thanks a bunch! For a reference, here's how I would build a google Query, and I'll tell you how long it too me to make this:
$PathToFolder = 'C:\users\ME\temp'
[System.Reflection.Assembly]::LoadFrom("{0}\WebDriver.dll" -f $PathToFolder)
if ($env:Path -notcontains ";$PathToFolder" ) {
$env:Path += ";$PathToFolder"
}
$Firefoxoptions = New-Object OpenQA.Selenium.Firefox.Firefoxoptions
$Firefoxoptions.AcceptInsecureCertificates = $True
$Firefoxdriver = New-Object OpenQA.Selenium.Firefox.Firefoxdriver($Firefoxoptions)
$Firefoxdriver.Url = "https://google.com"
$Firefoxdriver.FindElementByXPath("/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div[2]/div[2]/input").SendKeys("Let me google that for you")
$Firefoxdriver.FindElementByXPath("/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div[2]/div[2]/input").SendKeys([OpenQA.Selenium.Keys]::ENTER)
Naturally I got the captcha, but this took me 5 minutes and 20 seconds to make because I'm slow to find what I'm needing, and I'm honestly copy/pasting from old scripts I've made to make it slightly faster for me.
Thanks for any info!
I've used https://ui.vision/ to do this before. It was a bit daunting at first but it ended up saving me hours of boring work.
I'm not entirely sure of the limitations. My specific use case was to read a name from a list, search for their profile in our CMS, then to delete specific bits of data.
Best of luck!
Couldn't agree more!
Just wait until you see what you can do as you progress.... it's like you having an employee that never takes off or complains. Between PS7 and UI.Vision (for browser automation) there hasn't been anything that I haven't been able to automate.
I would recommend UI.Vision . You can easily call a simple macro to do this in PS with one line of code.
I use UI.Vision for anything that needs to be automated in the browser, and PS for everything else. The two make a powerful combination in which I haven't come across anything that I haven't been able to automate with these.
You can easily do this with UI.Vision RPA: https://chrome.google.com/webstore/detail/uivision-rpa/gcbalfbdmfieckjlnblleoemohcganoc?hl=en
You can also incorporate this into any PS script
From my novice experience making two scraper programs for my own use, I would try Selenium to do the job. Especially if it's a JavaScript website.
I've also used the Chrome/Firefox extension UI.Vision RPA to see the xpath/CSS selector I'm actually interacting with.
https://ui.vision/ bro just check this out, I can even give you a tutorial on what you want to do. Ui.vision is a low code version of python selenium, and it can also be used for desktop automation. I'm using it for https://www.getnewfuture.com/ a side project of mine.
Good question! I'm sorry to say I'm not very familiar with Macs, but there seem to be two programs, possibly already included with your operating system: AppleScript and Automator. I also found the open-source UI.Vision. Try and see, if there's something in there with which you can create your desired functionality.
https://ui.vision/rpa/docs/selenium-ide/executescript
> The executeScript command executes a snippet of JavaScript in the context of the currently selected frame or window. The script fragment will be executed as the body of an anonymous function. To store the return value, use the 'return' keyword and provide a variable name in the value input field.
there is a company called uipath which is offering a framework called 'robotic process automation' or rpa. i havent studied it in detail, but they have a free browser automation tool that looks easy enough to do, it includes features like 'form filling'.
https://ui.vision/rpa/browser-automation
i am not affiliated with these people nor am i endorsing them.