Python -Selenium - Bluemix - Running selenium on Bluemix - python

I have a scraping script which uses selenium.
Is there any way to deploy it under IBM Bluemix?
P.S. as i see the main problem is launching webdriver browser in a web application.

Related

I can't click on anything using selenium on a virtual machine web browser

[I'm kind of new using python/selenium]
I wrote a script where it extracts some data from a website, it was working just fine...! until recently the website migrated to an Amazon web server application. Now to access it I use a kind of web browser inside of web browser (like a virtual machine) and because of that I'm not able to click on anything with my script anymore.
I open the website with chrome web driver. and the virtual machine opens a firefox web browser inside the chromedriver.
I tried to switch to geckodriver.exe(firefox) but still can't click on anything.
I keep getting these errors:
NoSuchElementException: Message: Unable to locate element.

Can I use selenium webdriver on a non-gui server? (Python)

I want to use the selenium webdriver on a linux server running Ubuntu. How can I use selenium on said server without opening a browser, as it doesn't have one? I'm using Selenium with Python and Gecko(Firefox), but I'll be willing to switch to JavaScript or Chrome if I have to.

Django deployed in IIS is not working with Selenium

I have a Django web app hosted in IIS with a function using selenium that automates the transfer of data from another application. It runs when I run it on my localhost, however with IIS it doesn't even pull up the browser.
I pasted the code that pulls up a website I need:
from selenium import webdriver
def transfer(request):
browser = webdriver.Chrome()
browser.get('http://localhost/virtus#scorecard/rateteammember')
browser.set_page_load_timeout(10)
I am using windows 10 and IIS version 10.0.15063.0
I am also using ChromeDriver version 2.42.591088 that says 'Only local connections are allowed' which I think is the source of the problem.
Can someone please advise what to do next.

Selenium: How to work with already opened web application in Chrome

I'm looking for a solution that could help me out automating the already opened application in Chrome web browser using Selenium and Python web driver. The issue is that the application is super secured, and if it is opened in incognito mode as Selenium tries to do, it sends special code on my phone. This defeats the whole purpose. Can someone provide a hacky way or any other work around/open source tool to automate the application.
Selenium doesn't start Chrome in incognito mode, It just creates a new and fresh profile in the temp folder. You could force Selenium to use the default profile or you could launch Chrome with the debug port opened and the let Selenium connect to it. There is also a third way which is to preinstall the webdriver extension in Chrome. These are the only ways I've encountered to automate Chrome with Selenium.

How can I execute a python script at the same time another application begins running?

I'm still a novice to Python but I would like my python script to start running the moment I click on the Google Chrome icon to open up chrome. Is it possible for the script to start and run in response to other applications (such as Chrome) being used?
You could accomplish this via the command line:
Windows
C:\Users\path\to\python\script>start chrome & python script.py
OS X
$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome) & python ~/path/to/file/script.py
The & in the command allows you to open Google Chrome (or the web browser of your choosing) in the background while executing your Python script in the foreground.
Regarding Chrome specifically, you might also explore Google startup scripts, though it appears that you have to sign up for Google's Cloud services to implement these.

Categories