data extraction from google chrome - excel

I want to get table data from money control website. http://www.moneycontrol.com/financials/infosys/results/consolidated-quarterly-results/IT. I want to use google chrome to open this link and then click on previous years link and get that table too along with the table on that page. I need to click previous years as the url even after clicking previous years remains the same and I cannot directly navigate to it. It is easy with internet explorer but I cannot use it. If there is any other method other than having to click on the link please tell.

Without using a third party library it is only possible to use the Internet Explorer object.
To automate Google Chrome you can try to use Selenium VBA. It's a COM library which creates a Windows COM wrapper for Selenium.
http://florentbr.github.io/SeleniumBasic/
In Google Chrome you have to install a plugin, which helps executing the VBA commands in Chrome.
Download page: http://www.seleniumhq.org/download/

Related

Force open a shared SharePoint list link in a browser on a mobile device

I have a SharePoint list that I would like to share with external users, some might not have a Microsoft 365 account. I have created the link so anyone have access to the list. The link works great in a browser on a laptop when I open in a private browser.
I then generate a QR code for this link. When I scan the QR code on an iOS mobile device it force open in the Microsoft Lists app. It then says "Permission Required - You don't have permission to view this list".
I then tried to open the link in a browser on an iOS mobile device and that worked fine.
So the question is. How do I force the link to open in a browser instead of the Microsoft Lists app?
I have tried to append "web=1" to the link but that doesn't change anything.
If you’re using an iPhone, there are a few different ways to open links in your browser of choice instead of in the default app. One way is to long press on the link (this works in most apps), which will bring up a menu with the option to “Open in Safari.” You can also change your default browser settings so that all links automatically open in Safari or another browser.

Handling file download popup of chromium browsers using VBA

I'm using Selenium with VBA and Microsoft Edge to collect information, and download some files from a webpage. Everything works great except for the downloading part.
On this example site: https://file-examples.com/index.php/sample-documents-download/sample-doc-download/, Code like
oWebDriver.FindElementByXPath("//a[#href=""https://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc""]").Click
will result in a popup like this:
Unfortunately, it is not possible to simply change the browser's preferences in my case, because the macro will be running on a machine with limited authorization and the following setting can not be changed:
The last option can be translated to: "Ask for the storage location with every download" and it is locked.
It seems that the "Save As" popup in the first screenshot can't be accessed, neither with Selenium nor with SendKeys.
So the only option seems to be using the Windows API with VBA to somehow automate this step, however, even so, it seems to be impossible to get a handle on this pesky popup. I tried finding the window with Spy++ and it doesn't seem to show up as a separate window:
The only solution I can now think of is getting the window size of the parent Edge browser window, navigating the mouse to the approximate position of the "Save As" button, and clicking it there using VBA and the Windows API. Obviously, This is not a great solution, as it would be quite frail and can easily break with the smallest misalignment.
Is there any other way to automate this step that doesn't require moving the mouse and automating the "manual" clicking, using only VBA with Selenium?
Selenium only works for browser web page automation. The pop-up is not a part of the wab page so Selenium will not be able to recognize it.
And I think any setting in Selenium including "download.prompt_for_download" won't have effect. The pop-up is controlled by the browser setting, and the browser setting is controlled by your group policy, you can't override it with Selenium settings.
I think the only way is to use some 3rd party UI automation library to click that option along with Selenium, just like what you said in the question.

Get already opened Edge (not IE) browser window(s) and scrape contents

I used to be able to find all open IE windows via VBA and was able to access one of the already-opened page's contents in Excel with the objShell object mechanism. I didn't--and don't need--direct "control" (automation) of the browser in terms of pushing buttons, opening urls, etc.
I know automation of Edge is not possible just using VBA, but is there any ability to simply 1.) get a list of MS EDGE open windows and 2.) retrieve the elements within a given (already opened) window without resorting to downloading drivers and utilities like Selenium?
As Tim Williams had informed you there is no COM interface available for the Edge browser.
Microsoft has not provided any way to automate the Edge browser using VBA automation.
So, there is no way to fetch the already opened instance of the Edge browser and retrieve elements with the help of VBA.
I suggest you use the officially recommended way Selenium Web Driver to automate the Edge browser.
I have seen that you want to avoid the Selenium Web Driver approach but at present, this is the only way available to automate the Edge browser.
If you are having any issues with the Selenium Web Driver approach then you can inform us about it. We can try to provide suggestions for it.
Thanks for your understanding.
Please note: I'm the author of this software
You can connect to active instances of Edge with IE mode using Internet Controls for Edge: https://pomio.dk/internet-controls-for-edge/.
Internet Controls for Edge is a COM component and it exposes the same APIs as Microsoft Internet Controls (for Internet Explorer), so if you've already created some automations of Internet Explorer (using Microsoft Internet Controls), then it should be straight forward to move to Internet Controls for Edge.

Activating / clicking a browser extension in Firefox with Selenium in Python 3

I am writing a script for web automation with SELENIUM and, in theory, I have two options to capture the data I need from the websites I am scraping:
I can let the script extract relevant information from each tag on the result pages.
I can make the script click on the browser extension button in my browser window and let the extension manage the data for me.
I know how to extract information by HTML tag, but when it comes to browser extensions, I have only found instructions how to install / uninstall them with SELENIUM, but no instructions how to "activate" them once they are installed.
I am using Firefox and would be very grateful if you could point me in the right direction.
I was not able to solve this problem in FIREFOX but in CHROME:
I created a browser profile including my extension and a key shortcut to activate it.
I opened that profile when starting the browser with SELENIUM.
I used SELENIUM to navigate to the right URL.
I used pyautogui to press the relevant keys and trigger the file download.

Can you add a chrome extension in to a iframe, and if you can how?

I've been trying to get some unblocked games on my school computer and one way I found out is to run them through an iframe. But I've been asked to add some cheats onto one of the games. So I need to somehow add a chrome extension onto an iframe. Help.
Edit: I don't want to create my own extension but I want to use one I found on GitHub. I also can't add any extensions on my school computer developer mode or not.
Here is the extension i want to use https://github.com/Kalaborative/survivio-plus

Resources