I'm trying to install a chrome extension which is available in the Chrome Web Store on a specific chrome profile.
I was trying to do that with Python and Selenium (with the add_extension function) it works, but in reality it only loads it during the program. Indeed, when I click on the google shortcut after the program is finished, the extension is not installed.
I already had a look on the internet (with Chrome API), but there was no answer which fits my issue.
Thanks !
Related
I am using python and Selenium for a project.
But I am stuck trying to open a web page.
To access this page you require to authenticate and then press a usb device for second factor authentication, but only one time for each browser session.
I always get the page "you did not present a posture cookie. please install or repair your AEA plugin"
Comparing a manual browser it seems to have the plugin.
I have tried the following:
1)Tried by authenticating manually and then saving the browser cookies.
2)I have also tried by adding chrome_options.add_argument("user-data-dir=C:\Users\"+username+"\AppData\Local\Google\Chrome\User Data\Default") that is apparently where cookies are stored but both method fails.
I found the plugin ID, packed the plugin and tried to add the extension to the webdriver, but got the error "Loading of unpacked extensions is disabled by the administrator."
Is there any way to make the os thing that I browsing manually? By searching I fund that the option options.setExperimentalOption("useAutomationExtension", false); used to work on previous chrome webdriver versions, but is not working anymore, and disabling all plugins does not seem to be an option here.
Any advice would be appreciated.
I'm trying to write a python executable that runs in the background and records the amount of time I spend on facebook. This is one of my first projects in software development. The problem is, I haven't found a way to access the chrome browser and look at what URL's are open.
I've used selenium webdriver, but it seems to only be able to open up new tabs.
I've found some kind of google extension called google tabs api, but i'm not entirely sure if it even is a library I can import into python or if it's even meant for python.
What is an easy(simple/clean) way to add few steps to interact with windows based elements within python selenium script?
eg:
Click a download button via selenium driver, change the file name and location and click save button on windows dialog.
Note:
Downloads button is just an example. I pretty much want to know a common way to handle any kind of items.
I do not want a way where they recommend a way to configure browser such that downloads happen automatically at a specific location on our system.
Way to execute my scenario:
Keep this setting turned ON in chrome.
Ask where to save each file before downloading.
Website to try - https://www.seleniumhq.org/download/.
Try downloading anything.
There is a project called Winium, remote driver implementation of Selenium for automating desktop applications. This could help you with this job.
You can spy ui using Inspect.
Find the samples at https://github.com/2gis/Winium.Desktop/wiki/Magic-Samples
Try to use AUTO It, it will be useful in Interacting with windows based applications in selenium.
Check out here - https://www.guru99.com/use-autoit-selenium.html
Hope This Helps You.
I want to run BeautifulSoup and selenium webdriver in amazon lambda and my running environment is python 3.6. Is it possible to run ? if so How. My intention is to scrap datas from a webpage using beautiful soup 4 and selenium(Since it has to scrap data dynamically generated by javascript).
Yes, it's possible. You need to package a headless Chrome binary and chromedriver along with all the Python packages you need. You'll also need to set several options in Selenium's Chrome web driver to make it work.
I wrote a step-by-step tutorial after spending several frustrating weeks trying to deploy it.
You will need to create a deployment package and upload it to Lambda if you are going to use dependancies outside of the standard library.
I have a write up about using BS4 and Lambda together. I did not use Selenium within Lambda but I do have extensive Selenium experience. You will not be able to execute commands within a browser using Lambda. You are going to need to have a remote server stood up, running Selenium Server. Download Selenium and the webdrivers on the machine that you wish to do the web scraping, start the .jar file, it will open a port on the machine Selenium will communicate with.
Considering that you will need a machine running probably windows to fire up a browser and scrape these pages, you probably don't need lambda in the end.
I have process that uses iMacros in Firefox to open some websites and click on some buttons and do some stuff (not any weird stuff, internal work pages). The problem is that I basically can't use my computer while that happens.
I want to automate this via python and found this:
Integrating iMacros scripts into python
However the answer to that question and the links mention that I need the business or enterprise version of it.
Is there a way to just do something like:
Open firefox (I know how)
Use (as a plugin) iMacros to run a iim script in x location
Thanks!!
You can have 100% control over Firefox with Python, as both are open source. The trick is to figure out details. Here are some starting points
Python can script Firefox with Selenium WebDriver
With some tricks, you can dive deeper into Firefox what basic Selenium interaction offers, like opening a web pages. This would include giving direct commands to plugins. Here is an example of settings Firefox profile in a mode that normal security restrictions do not apply.
You need to study Firefox architecture how you can trigger iMacros plugin commands from Selenium. This is the tricky part as this is very marginal use case and there might not be much information available. Expect spending few days of learning Firefox internals.
My guess is that you can disable Firefox security, and then use Selenium WebDriver to run a JavaScript snippet which gives direct commands to iMacros component.